hypercast.DT
Class DT_Node_ServerJoin

java.lang.Object
  |
  +--hypercast.DT.DT_Node
        |
        +--hypercast.DT.DT_Node_ServerJoin
All Implemented Interfaces:
I_AdapterCallback, I_Node, I_Stats

public class DT_Node_ServerJoin
extends DT_Node

This class extends the basic Delaunay triangulation node to provide a mechanism for joining a overlay or resolving partitions through a server. Partition solving and Joins are initiated by the node sending a ServerRequest message to the Server. The server responds by sending a ServerReply message back to the node. The ServerReply message contains a node that is already in the overlay.

The new node then sends this node a NewNode message. The NewNode message will be routed on the topology until it reaches a node where the new node can pass the neighbor test. The routing is done by compass routing. That node will then attempt to add the new node as a neighbor.


Field Summary
static float BACKOFF_RATIO
          When server does not respond, ratio of backoff.
static int DEAD
          Node state
static int INCOMPLETE
          Node state
static int JOINING
          Node state
static int LEADER_INCOMPLETE
          Node state
static int LEADER_STABLE
          Node state
static int MAX_CONTACT_SERVER_NUMBER
          Times a node trys to contact DT server before exit.
static java.lang.String MAX_SERVER_TIME_PROPERTY_NAME
          Name of property controlling the maximum server delay before trying a backup server.
static java.lang.String MIN_SERVER_TIME_PROPERTY_NAME
          Name of property controlling the default server heartbeat time.
static java.lang.String SERVER_PREFIX
          Prefix for the name of the properties holding the URLs of the servers.
static int SERVER_TIMER_INDEX
          Adapter timer index used for server heartbeat.
static int STABLE
          Node state
static int UNCONFIRMED_LEADER_INCOMPLETE
          Node state
static int UNCONFIRMED_LEADER_STABLE
          Node state
 
Fields inherited from interface hypercast.I_Node
DEFAULT_CONFIG_FILE, PROTOSUB_BUDDYLIST, PROTOSUB_MULTICAST, PROTOSUB_NOSPEC, PROTOSUB_SERVER
 
Constructor Summary
DT_Node_ServerJoin(hypercast.HyperCastConfig c, hypercast.I_UnicastAdapter a)
           
DT_Node_ServerJoin(hypercast.HyperCastConfig c, hypercast.I_UnicastAdapter a, hypercast.DT.DT_LogicalAddress startingCoords)
           
DT_Node_ServerJoin(hypercast.HyperCastConfig c, hypercast.I_UnicastAdapter a, hypercast.DT.DT_LogicalAddress startingCoords, java.lang.String prefix)
           
DT_Node_ServerJoin(hypercast.HyperCastConfig c, hypercast.I_UnicastAdapter a, java.lang.String prefix)
           
 
Method Summary
 int getState()
          Returns the current state of the node.
 void joinOverlay()
          Joins overlay multicast overlay.
 void leaveOverlay()
          Leaves overlay multicast Overlay.
 void messageArrivedFromAdapter(hypercast.I_Message a)
          I_AdapterCallback function.
 void timerExpired(java.lang.Object TimerIndex)
          Handles timer events, such as when the Leader sends a message to the server.
 
Methods inherited from class hypercast.DT.DT_Node
createDTMessage, createLogicalAddress, createLogicalAddress, deleteNeighbor, getAddressPair, getAllNeighbors, getChildren, getNextHopToLeader, getParent, getReadSchema, getStats, getStatsName, getWriteSchema, isLeader, previousHopCheck, restoreMessage, setLogicalAddress, setNotificationHandler, setStats, setStatsName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_SERVER_TIME_PROPERTY_NAME

public static final java.lang.String MIN_SERVER_TIME_PROPERTY_NAME
Name of property controlling the default server heartbeat time.

See Also:
Constant Field Values

MAX_SERVER_TIME_PROPERTY_NAME

public static final java.lang.String MAX_SERVER_TIME_PROPERTY_NAME
Name of property controlling the maximum server delay before trying a backup server.

See Also:
Constant Field Values

SERVER_PREFIX

public static final java.lang.String SERVER_PREFIX
Prefix for the name of the properties holding the URLs of the servers.

See Also:
Constant Field Values

SERVER_TIMER_INDEX

public static final int SERVER_TIMER_INDEX
Adapter timer index used for server heartbeat.

See Also:
Constant Field Values

BACKOFF_RATIO

public static final float BACKOFF_RATIO
When server does not respond, ratio of backoff.

See Also:
Constant Field Values

MAX_CONTACT_SERVER_NUMBER

public static final int MAX_CONTACT_SERVER_NUMBER
Times a node trys to contact DT server before exit.

See Also:
Constant Field Values

JOINING

public static final int JOINING
Node state

See Also:
Constant Field Values

STABLE

public static final int STABLE
Node state

See Also:
Constant Field Values

LEADER_STABLE

public static final int LEADER_STABLE
Node state

See Also:
Constant Field Values

INCOMPLETE

public static final int INCOMPLETE
Node state

See Also:
Constant Field Values

LEADER_INCOMPLETE

public static final int LEADER_INCOMPLETE
Node state

See Also:
Constant Field Values

UNCONFIRMED_LEADER_STABLE

public static final int UNCONFIRMED_LEADER_STABLE
Node state

See Also:
Constant Field Values

UNCONFIRMED_LEADER_INCOMPLETE

public static final int UNCONFIRMED_LEADER_INCOMPLETE
Node state

See Also:
Constant Field Values

DEAD

public static final int DEAD
Node state

See Also:
Constant Field Values
Constructor Detail

DT_Node_ServerJoin

public DT_Node_ServerJoin(hypercast.HyperCastConfig c,
                          hypercast.I_UnicastAdapter a,
                          hypercast.DT.DT_LogicalAddress startingCoords)

DT_Node_ServerJoin

public DT_Node_ServerJoin(hypercast.HyperCastConfig c,
                          hypercast.I_UnicastAdapter a,
                          hypercast.DT.DT_LogicalAddress startingCoords,
                          java.lang.String prefix)

DT_Node_ServerJoin

public DT_Node_ServerJoin(hypercast.HyperCastConfig c,
                          hypercast.I_UnicastAdapter a)

DT_Node_ServerJoin

public DT_Node_ServerJoin(hypercast.HyperCastConfig c,
                          hypercast.I_UnicastAdapter a,
                          java.lang.String prefix)
Method Detail

joinOverlay

public void joinOverlay()
Joins overlay multicast overlay.

Specified by:
joinOverlay in interface I_Node
Overrides:
joinOverlay in class DT_Node

leaveOverlay

public void leaveOverlay()
Leaves overlay multicast Overlay.

Specified by:
leaveOverlay in interface I_Node
Overrides:
leaveOverlay in class DT_Node

messageArrivedFromAdapter

public void messageArrivedFromAdapter(hypercast.I_Message a)
I_AdapterCallback function. It handles all messages from the server and passes all other messages on to DT_Node.messageArrivedFromAdapter.

Specified by:
messageArrivedFromAdapter in interface I_AdapterCallback
Overrides:
messageArrivedFromAdapter in class DT_Node

timerExpired

public void timerExpired(java.lang.Object TimerIndex)
Handles timer events, such as when the Leader sends a message to the server. It does call super.handleTimer() to take care of other timer events.

Specified by:
timerExpired in interface I_AdapterCallback
Overrides:
timerExpired in class DT_Node

getState

public int getState()
Returns the current state of the node. State is one of: JOINING, STABLE, LEADER_STABLE, INCOMPLETE, or LEADER_INCOMPLETE.