|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--edu.virginia.cs.mng.hypercast.DT.DT_Node
This class is a basic Delaunay triangulation node. That is, it maintains logical links and can resolve most bad configurations, but it does not have any mechanism for joining a Overlay or resolving partitions. A derived class (such as DT_Node_ServerJoin) must contain a mechanism for joining the Overlay.
| Field Summary | |
protected I_UnicastAdapter |
adapter
Network adapter (used for timers and Physical Address). |
private java.util.Vector |
bandwidthCheckpoints
Vector of DT_BandwidthCheckpoint. |
protected OverlaySocketConfig |
config
Source of constants & error/log message display |
private long |
FAST_HEARTBEAT_TIME
In milliseconds, the maximum time to wait to send a message to the neighbors informing them of a change to the neighbor table. |
private static long |
FAST_HEARTBEAT_TIME_DEFAULT
String for the default update time. |
private static java.lang.String |
FAST_HEARTBEAT_TIME_PROPERTY_NAME
Name of property controlling update. |
private static int |
HEARTBEAT_TIMER_INDEX
Adapter timer index used for heartbeat. |
private boolean |
HeartbeatSetToFastHeartbeat
Keeps track of whether heartbeat is set to Fast or Slow heartbeat. |
protected boolean |
joined
True if joinOverlay has been called without matching leaveGroup. |
private long |
lastChangeToNeighborhood
Time of last change to the neighborhood. |
private double |
maxReceiveRateInAHeartbeat
Max burst seen since last joinOverlay. |
private double |
maxSendRateInAHeartbeat
Max burst seen since last joinOverlay. |
(package private) java.lang.String |
MessageCallBackDebug
Debug string. |
protected int |
messagesReceivedInLastHeartbeat
Used the calculate the burst-message-load. |
protected int |
messagesSentInLastHeartbeat
Used the calculate the burst-message-load. |
protected DT_Neighborhood |
neighborhood
The list of neighbors |
private static java.lang.String |
NODE_COORDS_DEFAULT
String for the default coordinates. |
private static java.lang.String |
NODE_COORDS_PROPERTY_NAME
Name of property controlling coordinates. |
protected static java.util.Random |
rand
It may be used to generate the node's LogicalAddress. |
private long |
SLOW_HEARTBEAT_TIME
In milliseconds, the time between the keep-alive messages. |
private static long |
SLOW_HEARTBEAT_TIME_DEFAULT
String for the default keep alive time. |
private static java.lang.String |
SLOW_HEARTBEAT_TIME_PROPERTY_NAME
Name of property controlling keep alive. |
private boolean |
StableAtHeartbeat
True if isStable() returned true at the last expiration of the heartbeat timer. |
(package private) java.lang.Object |
startStopLock
Object used to prevent problems while starting and stopping the node. |
private long |
startTime
Time of the call to joinGroup() |
(package private) TimedStopper |
stopper
Object used to stop all threads TIMEOUT seconds after the call to leaveGroup(). |
private long |
stopTime
Time of the call to leaveGroup() |
private long |
timeOfLastHeartbeat
Used the calculate the burst-message-load. |
protected long |
TIMEOUT_TIME
In milliseconds, the time required before a silent neighbor is removed. |
private static long |
TIMEOUT_TIME_DEFAULT
String for the default timeout time. |
private static java.lang.String |
TIMEOUT_TIME_PROPERTY_NAME
Name of property controlling timeout time. |
(package private) java.lang.String |
TimerCallBackDebug
Debug string. |
private boolean |
timerCleared
Used to coordinate resetting and clearing of the heartbeat timer. |
| Constructor Summary | |
(package private) |
DT_Node(OverlaySocketConfig c,
I_UnicastAdapter a)
|
(package private) |
DT_Node(OverlaySocketConfig c,
I_UnicastAdapter a,
DT_LogicalAddress startingCoords)
|
| Method Summary | |
protected void |
changeSlowHeartbeatToFastHeartbeat()
|
private DT_LogicalAddress |
createLogicalAddress()
Creates the node's logical address given properties. |
I_LogicalAddress |
createLogicalAddress(byte[] array,
int offset)
Constructs a DT_LogicalAddress from a byte array. |
void |
deleteNeighbor(DT_AddressPair dtap)
Deletes a neighbor from the neighborhood table and updates timers. |
I_AddressPair[] |
getAllNeighbors()
Returns the AddressPairs of all the neighbors |
I_AddressPair[] |
getChildren(I_LogicalAddress root)
Return the AddressPairs of neighbor that are children of this node in a spanning tree rooted at rootCoords. |
I_AddressPair |
getMyAddressPair()
Returns the physical address/logical address pair of this node. |
I_AddressPair |
getNextHopToLeader()
Returns the AddressPair of the neighbor with the greatest coordinates. |
I_AddressPair |
getParent(I_LogicalAddress root)
Returns AddressPair of neighbor that is parent of this node in a spanning tree rooted at rootCoords. |
java.lang.String[] |
getSchema()
Part of I_Stats interface. |
java.lang.String |
getStats(java.lang.String name)
Part of I_Stats interface. |
protected void |
goodbyeAllNeighbors()
Sends a Goodbye message to all of the node's neighbors. |
private void |
handleGoodbye(DT_Message m)
Removes the sender of the message from the neighborhood. |
private void |
handleHello(DT_Message m)
Preforms actions associated with the arrival of a Hello or HelloNotNeighbor message. |
protected void |
handleNewNode(DT_Message m)
Used by NewNode method of joins. |
protected void |
handleNodePing(DT_Message m)
|
private void |
handleTimeoutTimer(long currentTime)
Remove nodes that have timed out. |
protected void |
helloAllNeighbors()
Sends a Hello message to all of the node's neighbors. |
private boolean |
isCandidateNeighbor(DT_AddressPair dest)
|
boolean |
isLeader()
Returns true if none of the node's neighbors has a greater logical address. |
void |
joinGroup()
Joins the overlay multicast group. |
void |
leaveGroup()
Leaves the overlay multicast group. |
void |
messageArrivedFromAdapter(I_Message a)
This function, a member of I_AdapterCallBack, is called whenever a protocol message arrives. |
I_Message |
restoreMessage(byte[] buffer,
int[] startValidBytes,
int endValidBytes)
Creates a protocol message from a byte[]. |
protected void |
sendGoodbyeMessage(DT_AddressPair dst)
Sends a Goodbye message to a node. |
protected void |
sendHelloNeighborMessage(DT_AddressPair dst)
Sends a Hello message to a node. |
protected void |
sendHelloNotNeighborMessage(DT_AddressPair dst)
Send a HelloNotNeighbor message to a node |
private void |
sendHellosToCandidateNeighbors()
|
protected void |
sendNewNodeMessage(DT_AddressPair dst,
DT_AddressPair target)
|
protected void |
sendTestMessage(DT_AddressPair dst,
DT_AddressPair target)
|
void |
setStats(java.lang.String name,
java.lang.String value)
Part of I_Stats interface. |
void |
timerExpired(int timerIndex)
This function, a member of I_AdapterCallBack, is called for the heartbeat timer. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected static java.util.Random rand
private static final int HEARTBEAT_TIMER_INDEX
private static final long SLOW_HEARTBEAT_TIME_DEFAULT
private static final java.lang.String SLOW_HEARTBEAT_TIME_PROPERTY_NAME
private static final long FAST_HEARTBEAT_TIME_DEFAULT
private static final java.lang.String FAST_HEARTBEAT_TIME_PROPERTY_NAME
private static final long TIMEOUT_TIME_DEFAULT
private static final java.lang.String TIMEOUT_TIME_PROPERTY_NAME
private static final java.lang.String NODE_COORDS_DEFAULT
private static final java.lang.String NODE_COORDS_PROPERTY_NAME
private long SLOW_HEARTBEAT_TIME
private long FAST_HEARTBEAT_TIME
protected long TIMEOUT_TIME
private boolean timerCleared
protected DT_Neighborhood neighborhood
protected OverlaySocketConfig config
protected I_UnicastAdapter adapter
protected boolean joined
private long timeOfLastHeartbeat
protected int messagesReceivedInLastHeartbeat
protected int messagesSentInLastHeartbeat
private double maxReceiveRateInAHeartbeat
private double maxSendRateInAHeartbeat
private java.util.Vector bandwidthCheckpoints
DT_BandwidthCheckpointprivate boolean HeartbeatSetToFastHeartbeat
private boolean StableAtHeartbeat
java.lang.String TimerCallBackDebug
java.lang.String MessageCallBackDebug
private long startTime
private long lastChangeToNeighborhood
private long stopTime
java.lang.Object startStopLock
TimedStopper stopper
| Constructor Detail |
DT_Node(OverlaySocketConfig c,
I_UnicastAdapter a)
DT_Node(OverlaySocketConfig c,
I_UnicastAdapter a,
DT_LogicalAddress startingCoords)
| Method Detail |
private DT_LogicalAddress createLogicalAddress()
public void joinGroup()
public void leaveGroup()
public I_Message restoreMessage(byte[] buffer,
int[] startValidBytes,
int endValidBytes)
I_AdapterCallBack.restoreMessage(byte[], int[], int)public boolean isLeader()
public I_AddressPair getMyAddressPair()
public I_AddressPair getParent(I_LogicalAddress root)
rootCoords.
This is calculated by finding the neighbor that forms the smallest angle with rootCoords.public I_AddressPair[] getChildren(I_LogicalAddress root)
rootCoords.
This based on if DT_Node.getParent() of the neighbor would return this node.public I_AddressPair[] getAllNeighbors()
public I_AddressPair getNextHopToLeader()
public I_LogicalAddress createLogicalAddress(byte[] array,
int offset)
public void timerExpired(int timerIndex)
private void handleTimeoutTimer(long currentTime)
private void sendHellosToCandidateNeighbors()
private boolean isCandidateNeighbor(DT_AddressPair dest)
protected final void helloAllNeighbors()
public void messageArrivedFromAdapter(I_Message a)
private void handleGoodbye(DT_Message m)
private void handleHello(DT_Message m)
protected void handleNewNode(DT_Message m)
protected void handleNodePing(DT_Message m)
protected final void changeSlowHeartbeatToFastHeartbeat()
protected final void goodbyeAllNeighbors()
protected final void sendHelloNeighborMessage(DT_AddressPair dst)
protected final void sendHelloNotNeighborMessage(DT_AddressPair dst)
protected final void sendGoodbyeMessage(DT_AddressPair dst)
protected void sendNewNodeMessage(DT_AddressPair dst,
DT_AddressPair target)
protected void sendTestMessage(DT_AddressPair dst,
DT_AddressPair target)
public void deleteNeighbor(DT_AddressPair dtap)
public java.lang.String getStats(java.lang.String name)
throws StatsException
I_Stats.getStats(java.lang.String)
public void setStats(java.lang.String name,
java.lang.String value)
throws StatsException
I_Stats.setStats(java.lang.String, java.lang.String)
public java.lang.String[] getSchema()
throws StatsException
I_Stats.getSchema()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||