|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.tapestry.impl.RoutingTable
Implements the routing table interface.
Inner Class Summary | |
static class |
RoutingTable.Available
|
Field Summary | |
PatchworkTable |
_patchwork
|
static int |
BITS_PER_DIGIT
|
static int |
DIGIT_VALUES
|
static int |
DIGITS_PER_GUID
|
int |
node_status
|
Constructor Summary | |
RoutingTable(InputBuffer buffer)
|
|
RoutingTable(NodeId self_node_id,
SecureHash guid)
|
|
RoutingTable(NodeId self_node_id,
SecureHash guid,
Classifier classifier)
|
Method Summary | |
RouteEntry |
_route_to_root(int[] dest_digits,
boolean exact,
boolean prefix,
int[] digit)
|
RouteEntry |
_surrogate(int[] dest_digits,
int dest_digit,
int hop)
|
boolean |
addBackup(int digit,
int value,
NodeId nid,
Double latency,
SecureHash guid)
Deprecated. As of 7/24/2002 in favor of RoutingTable.write() |
void |
addDistance(double rtt,
NodeId nid,
SecureHash newguid)
Method to add the latency measurement to the data structures |
boolean |
addSelf(SecureHash self)
|
int |
bits_per_digit()
|
int |
digit_values()
|
int |
digits_per_guid()
|
static int[] |
digits(SecureHash h)
|
Map |
get_node_map()
|
LinkedList |
get_removed_nodes()
|
NodeId |
get_self_node_id()
|
RouteEntry[][] |
get_table()
|
RouteEntry |
getEntry(int digit,
int value)
|
boolean |
isAttached()
|
NodeId |
nextSurrogate(HashSet ignoredNodes,
SecureHash selfguid)
method that calculates the NEXT best surrogate hop other than the current node for ANY key/GUID. |
SecureHash |
node_id_to_guid(NodeId node_id)
|
Double |
node_to_latency(NodeId node_id)
|
LinkedList |
optimize(double delta,
NodeId nid,
SecureHash newguid)
This function simply calls the more general optimize function with the minlevel set to 0 |
LinkedList |
optimize(double delta,
NodeId nid,
SecureHash newguid,
int minlevel)
|
static String |
printGuid(SecureHash x)
|
SecureHash |
put_node_id_to_guid(NodeId node_id,
SecureHash guid)
|
void |
putEntry(int digit,
int value,
RouteEntry re)
|
void |
pw_update(DeltaMsg pdrm)
Update the Patchwork statistics to RoutingTable, given the newest delta ent out by Patchwork model. |
NodeId |
read(int which_digit,
int digit_value)
|
boolean |
remove(TapestryNeighborInfo ni)
Remove for dummies. |
NodeId |
route_to_root(int[] dest_digits,
boolean exact,
boolean prefix,
int[] digit)
Route to the root of the tree for dest_digits , assuming
that the first digit [0] - 1 digits have already been
accounted for, and return the next node in the routing path. |
void |
serialize(OutputBuffer buffer)
Add the object to the buffer . |
protected void |
setSink(SinkIF sink)
|
NodeId |
surrogate(int[] dest_digits,
int dest_digit,
int hop)
Find the surrogate for an empty routing table entry. |
String |
toShortString()
|
String |
toString()
|
boolean |
write(int which_digit,
int digit_value,
NodeId node_id,
SecureHash node_guid,
Double latency)
Add primary/backup routes to the routing table. |
boolean |
write(TapestryNeighborInfo ni)
Write for dummies. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int BITS_PER_DIGIT
public static final int DIGITS_PER_GUID
public static final int DIGIT_VALUES
public int node_status
public PatchworkTable _patchwork
Constructor Detail |
public RoutingTable(NodeId self_node_id, SecureHash guid, Classifier classifier)
public RoutingTable(NodeId self_node_id, SecureHash guid)
public RoutingTable(InputBuffer buffer) throws QSException
Method Detail |
public boolean isAttached()
public int digit_values()
public int digits_per_guid()
public int bits_per_digit()
public SecureHash node_id_to_guid(NodeId node_id)
public SecureHash put_node_id_to_guid(NodeId node_id, SecureHash guid)
public Double node_to_latency(NodeId node_id)
public NodeId read(int which_digit, int digit_value)
public boolean write(TapestryNeighborInfo ni)
public boolean remove(TapestryNeighborInfo ni)
public boolean write(int which_digit, int digit_value, NodeId node_id, SecureHash node_guid, Double latency)
which_digit
- digit of entry being addeddigit_value
- value of entry's Guid at the relevant digitnode_id
- NodeId of entry being addedlatency
- Last tested latency of new entrynode_guid
- Guid of new entrypublic LinkedList optimize(double delta, NodeId nid, SecureHash newguid)
newguid
- The guid of some nodenid
- The nodeid of that nodedelta
- is the estimated RTT distance from us to that nodepublic LinkedList optimize(double delta, NodeId nid, SecureHash newguid, int minlevel)
newguid
- The guid of some nodenid
- The nodeid of that nodedelta
- is the estimated RTT distance from us to that nodeminlevel
- is the minimum level that changes can take placepublic boolean addBackup(int digit, int value, NodeId nid, Double latency, SecureHash guid)
digit
- digit of entry being addedvalue
- value of entry's Guid at the relevant digitnid
- NodeId of entry being addedlatency
- Last tested latency of new entryguid
- Guid of new entrypublic RouteEntry getEntry(int digit, int value)
public void putEntry(int digit, int value, RouteEntry re)
public void addDistance(double rtt, NodeId nid, SecureHash newguid)
rtt
- Estimated roundtrip distancenid
- NodeId of new nodenewguid
- Guid of new nodepublic NodeId route_to_root(int[] dest_digits, boolean exact, boolean prefix, int[] digit)
dest_digits
, assuming
that the first digit [0] - 1
digits have already been
accounted for, and return the next node in the routing path.dest_digits
- the digits of the destination GUIDexact
- whether this should be an exact match; if this
parameter is true, the function will return
null
if there is no such node.digit
- the digit to start routing fromnull
if there is no such node and
return _self_node_id
if the current
node is the deterministic rootpublic RouteEntry _route_to_root(int[] dest_digits, boolean exact, boolean prefix, int[] digit)
public NodeId surrogate(int[] dest_digits, int dest_digit, int hop)
dest_digits
- The array of ints representing the destination guiddest_digit
- The digit value that points to an empty entryhop
- Which hop are we looking for the surrogate route onnull
if we are definitely the
surrogate, and the NodeId
of the
next person to ask if we cannot tell from this
hop yet.public RouteEntry _surrogate(int[] dest_digits, int dest_digit, int hop)
public NodeId nextSurrogate(HashSet ignoredNodes, SecureHash selfguid)
public boolean addSelf(SecureHash self)
public static int[] digits(SecureHash h)
public String toString()
toString
in class Object
public String toShortString()
public static String printGuid(SecureHash x)
public void serialize(OutputBuffer buffer)
QuickSerializable
buffer
.serialize
in interface QuickSerializable
ostore.util.QuickSerializable
buffer
- the output buffer to add the object topublic Map get_node_map()
public RouteEntry[][] get_table()
public NodeId get_self_node_id()
public LinkedList get_removed_nodes()
public void pw_update(DeltaMsg pdrm)
protected void setSink(SinkIF sink)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |