|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectNode
public abstract class Node
Abstract base class of DV and LS node types. Implements common functionality -- most everything but timestep based routing table update.
Field Summary | |
---|---|
protected boolean |
failed
Indicator of whether or not this node has failed |
protected java.util.HashMap<Node,java.lang.Integer> |
lastHeardDelay
Each neighbor has a time since last heard from |
protected int |
lastUpdatedSlot
Time slot in which we last ran |
protected java.util.LinkedHashSet<Node> |
neighbor
Each node has a current list of neighbors |
protected static MyRandom |
rand
|
protected int |
uid
Each node has an integer UID. |
Constructor Summary | |
---|---|
Node()
|
Method Summary | |
---|---|
protected abstract void |
failureEvent()
Invoked when this node fails. |
RoutingTable |
getRoutingTable()
|
int |
getUID()
|
boolean |
hasFailed()
|
protected abstract void |
neighborFailureEvent(Node neighbor)
Invoked when a timeout indicates that a neighbor node has failed. |
void |
oracleComputeRoutingTable()
Fills in the routing table using an oracle (i.e., reliable/correct) view of network connectivity. |
void |
oracleFillTable(RoutingTable rt)
Fills in the routing table using an oracle (i.e., reliable/correct) view of network connectivity. |
protected abstract void |
processUpdate(UpdatePacket p)
Called for each update packet in this node's queue when it is selected to run during a time step. |
protected abstract void |
recoveryEvent()
Invoked when this node recovers from a failure. |
protected void |
sendUpdatePacket(Node dest,
UpdatePacket p)
Send an update packet |
boolean |
setHasFailed(boolean f)
Allows manipulation of failure/recovery of this node. |
void |
setupNeighborInformation()
Called as an initialization step, once the network topology is finalized. |
protected abstract void |
startUpdate()
When this node is selected to run during a time step, the "driver" code in Node.java: first calls this routine (startUpdate()) then with high, but not certain, probability calls processUpdate() for each update packet in the node's queue |
protected abstract void |
stopUpdate()
See startUpdate(). |
void |
swapInQueues()
Swaps the current and future in queues. |
void |
takeStep()
Causes node to read currentInQueue of update packets and act on them. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int uid
protected java.util.LinkedHashSet<Node> neighbor
protected java.util.HashMap<Node,java.lang.Integer> lastHeardDelay
protected int lastUpdatedSlot
protected boolean failed
protected static MyRandom rand
Constructor Detail |
---|
public Node()
Method Detail |
---|
public int getUID()
public RoutingTable getRoutingTable()
public boolean hasFailed()
public void oracleComputeRoutingTable()
public void oracleFillTable(RoutingTable rt)
public void setupNeighborInformation()
protected void sendUpdatePacket(Node dest, UpdatePacket p) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void swapInQueues()
public void takeStep()
public boolean setHasFailed(boolean f)
protected abstract void startUpdate()
protected abstract void processUpdate(UpdatePacket p)
protected abstract void stopUpdate()
protected abstract void failureEvent()
protected abstract void recoveryEvent()
protected abstract void neighborFailureEvent(Node neighbor)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |