|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.tapestry.impl.RouteEntry
Implements the routing table entry with multiple outgoing routes. This class supports sorted insertion of routes into the entry, and returns the best entry for general usage.
Inner Class Summary | |
static class |
RouteEntry.NodeEntry
|
Field Summary | |
static int |
LATENCY
|
static int |
LEAVING
|
static int |
LOCKED
|
static int |
LOSS
|
static int |
REDUNDANT_LVL
|
static short |
STATUS_ALIVE
|
static short |
STATUS_DEAD
|
static short |
STATUS_REPAIR_ONE
|
static short |
STATUS_REPAIR_TWO
|
Constructor Summary | |
RouteEntry()
|
|
RouteEntry(InputBuffer buffer)
|
|
RouteEntry(NodeId route,
Double latency)
|
|
RouteEntry(NodeId route,
Double latency,
int flag)
|
Method Summary | |
boolean |
add(NodeId newnode,
Double latency,
NodeId[] removed_node,
Pair[] frlschanged)
Function used to add a new entry to the RouteEntry. |
int |
get_frls()
|
NodeId |
getAtIndex(int i)
Method to return a NodeId at a position in the RouteEntry. |
RouteEntry.NodeEntry |
getEntryAt(int i)
|
NodeId |
getFirst()
Method to return the first (primary) NodeId address of this RouteEntry. |
NodeId |
getFRLS()
Method to return the frls NodeId address of this RouteEntry. |
RouteEntry.NodeEntry[] |
getRoutes()
|
boolean |
isLeavingAtIndex(int i)
Method to ask whether a NodeEntry at a particular position is in the process of leaving or not. |
boolean |
isLockedAtIndex(int i)
Method to ask whether a NodeEntry at a particular position is marked as locked (in the process of insertion) or not. |
boolean |
markLeaving(NodeId leavingnode)
Function to mark a node as leaving |
boolean |
need_multicast(int mcast_threshold)
|
Pair |
recalcFRLS()
Method to recalculate who the FRLS entry should point to. |
Pair |
removeEntry(NodeId node)
Search for an existing nodeid if it's in this entry, and remove it |
void |
serialize(OutputBuffer buffer)
Add the object to the buffer . |
void |
setEntryAt(int i,
RouteEntry.NodeEntry ne)
|
int |
size()
|
void |
sortRoutes(int criteria)
Sort the entry according the given criteria. |
void |
switchRoutes(int from,
int to)
|
String |
toString()
|
void |
updateLatency(NodeId route,
Double latency)
Search to see if route is actually part of this routeEntry. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int REDUNDANT_LVL
public static final int LOCKED
public static final int LEAVING
public static final int LOSS
public static final int LATENCY
public static final short STATUS_ALIVE
public static final short STATUS_DEAD
public static final short STATUS_REPAIR_ONE
public static final short STATUS_REPAIR_TWO
Constructor Detail |
public RouteEntry()
public RouteEntry(NodeId route, Double latency)
public RouteEntry(NodeId route, Double latency, int flag)
public RouteEntry(InputBuffer buffer) throws QSException
Method Detail |
public Pair recalcFRLS()
public boolean need_multicast(int mcast_threshold)
public RouteEntry.NodeEntry[] getRoutes()
public int get_frls()
public NodeId getFRLS()
public RouteEntry.NodeEntry getEntryAt(int i)
public void setEntryAt(int i, RouteEntry.NodeEntry ne)
public NodeId getFirst()
public NodeId getAtIndex(int i)
public boolean isLeavingAtIndex(int i)
public boolean isLockedAtIndex(int i)
public Pair removeEntry(NodeId node)
node
- The node to be replacedpublic boolean markLeaving(NodeId leavingnode)
leavingnode
- The node in process of leaving the networkpublic boolean add(NodeId newnode, Double latency, NodeId[] removed_node, Pair[] frlschanged)
removed_node
- Parameter hack for returning the node (if any) that
was kicked out of the table during this writing.
Like a pointer in C.public void switchRoutes(int from, int to)
public void sortRoutes(int criteria)
public void updateLatency(NodeId route, Double latency)
public String toString()
toString
in class Object
public int size()
public void serialize(OutputBuffer buffer)
QuickSerializable
buffer
.serialize
in interface QuickSerializable
ostore.util.QuickSerializable
buffer
- the output buffer to add the object to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |