|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--rice.pastry.client.PastryAppl | +--rice.pastry.client.CommonAPIAppl | +--rice.rm.RMImpl
Nested Class Summary | |
static class |
RMImpl.KEPenEntry
This is the per entry state corresponding to the m_pendingRanges hashtable that we maintain in the Keys Exchange Protocol. |
Field Summary | |
rice.pastry.routing.SendOptions |
_sendOptions
The SendOptions object to be used for all messaging through Pastry. |
rice.rm.RMClient |
app
Application that uses this Replica Manager. |
int |
m_eId
This is to keep track of events with respect to RMRequestKeysMsg only. |
java.util.Hashtable |
m_pendingEvents
This table will be used by the Timeout mechanism in RMRequestKeysMsg. |
java.util.Hashtable |
m_pendingRanges
This hashtable is keyed by the NodeId of the node to whom this local node is requesting for a set of keys in the Keys Exchange protocol. |
int |
m_seqno
This will be incremented for every message that this node sends remotely. |
static int |
MAXKEYSINRANGE
This value represents the maximum size of the keySet corresponding to a requested id range that we would like to fit in a single message. |
rice.pastry.IdRange |
myRange
This represents the range of object identifiers in the Id space for which this node (by virtue of its position in the Id Space relative to the positions of the other Pastry nodes) is an i-root (0<=i<=k). |
int |
rFactor
rFactor stands for the number of additional replicas for an object. |
static int |
SPLITFACTOR
This value represents the splitting factor by which a range is split into in the Keys Exchange Protocol. |
Fields inherited from class rice.pastry.client.PastryAppl |
address, instance, thePastryNode |
Constructor Summary | |
RMImpl(rice.pastry.PastryNode pn,
rice.rm.RMClient _app,
int _rFactor,
java.lang.String instance)
Builds a new ReplicaManager(RM) associated with a particular RMclient. |
Method Summary | |
void |
addPendingEvent(rice.pastry.NodeId toNode,
int eId)
Used to insert entries to the m_pendingEvents hashtable |
void |
addPendingRange(rice.pastry.NodeId toNode,
rice.pastry.IdRange reqRange)
Used to insert a pending range to the m_pendingRanges hashtable |
void |
deliver(rice.pastry.Id key,
rice.pastry.messaging.Message msg)
Called by pastry when a message arrives for this application. |
rice.pastry.security.Credentials |
getCredentials()
Returns the credentials for the application |
rice.pastry.NodeHandle |
getLocalHandle()
Gets the local NodeHandle associated with this Pastry node. |
rice.pastry.PastryNode |
getPastryNode()
Gets the underlying local Pastry node. |
java.util.Vector |
getPendingRanges(rice.pastry.NodeId toNode)
Gets the list of pending Ranges corresponding to a node that we are communicating to in the Keys Exchange Protocol. |
boolean |
isPendingEvent(rice.pastry.NodeId toNode,
int eId)
Used to check for existence of an entry in the m_pendingEvents hashtable |
boolean |
isReady()
Returns true if the RM substrate is ready. |
void |
lookupForward(rice.pastry.routing.RouteMessage msg)
Called by client(RMClient) to enable optimizations to route to the nearest replica. |
void |
notifyReady()
This is called when the underlying pastry node is ready. |
void |
periodicMaintenance()
This is the periodic maintenance protocol which removes stale objects as well as checks to see if there is any missing object. |
void |
printPendingRanges(rice.pastry.NodeId toNode)
Prints the list of pending Ranges corresponding to a node that we are communicating to in the Keys Exchange Protocol. |
void |
registerKey(rice.pastry.Id key)
Called by client(RMClient) to notify the RM substrate of the presence of a key corresponding to a object that was 'recently' inserted at itself. |
void |
removePendingEvent(rice.pastry.NodeId toNode,
int eId)
Used to remove entries to the m_pendingEvents hashtable |
void |
removePendingRange(rice.pastry.NodeId toNode,
rice.pastry.IdRange reqRange)
Used to remove a pending range to the m_pendingRanges hashtable |
void |
sendKeyRequestMessages(rice.pastry.NodeSet set,
java.util.Vector rangeSet)
We send RMRequestKeys messages to the the nodes in the 'set' asking for keys in the ranges specified in the 'rangeSet'. |
void |
splitPendingRanges(rice.pastry.NodeId toNode)
Iterates over the list of pending Ranges and splits the ranges if the expected number of keys in a range is greater than MAXKEYSINRANGE. |
void |
update(rice.pastry.NodeHandle nh,
boolean wasAdded)
Implements the main algorithm for keeping the invariant that an object would be stored in k closest nodes to the objectKey while the nodes are coming up or going down. |
void |
updatePendingRange(rice.pastry.NodeId toNode,
rice.pastry.IdRange reqRange,
int numKeys)
Used to update the state of a pending range to the m_pendingRanges hashtable. |
Methods inherited from class rice.pastry.client.CommonAPIAppl |
forward, leafSetChange, localLookup, messageForAppl, neighborSet, range, range, receiveMessage, replicaSet, route |
Methods inherited from class rice.pastry.client.PastryAppl |
enrouteMessage, getAddress, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, registerReceiver, routeMsg, routeMsgDirect, routeSetChange, sendMessage |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public rice.pastry.routing.SendOptions _sendOptions
public int m_seqno
public int m_eId
public rice.pastry.IdRange myRange
public int rFactor
public rice.rm.RMClient app
public java.util.Hashtable m_pendingRanges
public java.util.Hashtable m_pendingEvents
public static int MAXKEYSINRANGE
public static int SPLITFACTOR
Constructor Detail |
public RMImpl(rice.pastry.PastryNode pn, rice.rm.RMClient _app, int _rFactor, java.lang.String instance)
pn
- the PastryNode associated with this application_app
- the client associated with this replica manager_rFactor
- the replicaFactor associated with the replica managerinstance
- the string used to sucessfully instantiate different
application instances on the same pastry nodeMethod Detail |
public boolean isReady()
public rice.pastry.NodeHandle getLocalHandle()
public rice.pastry.PastryNode getPastryNode()
public void addPendingEvent(rice.pastry.NodeId toNode, int eId)
toNode
- the node with whom the local node is communicating
this is the key for this entry in the hashtableeId
- the event Id associated with this RMRequestKeys msg.public void removePendingEvent(rice.pastry.NodeId toNode, int eId)
toNode
- the node with whom the local node is communicating
this is the key for this entry in the hashtableeId
- the event Id associated with this RMRequestKeys msg.public boolean isPendingEvent(rice.pastry.NodeId toNode, int eId)
toNode
- the node with whom the local node is communicating
this is the key for this entry in the hashtableeId
- the event Id associated with this RMRequestKeys msg.public void addPendingRange(rice.pastry.NodeId toNode, rice.pastry.IdRange reqRange)
toNode
- the node with whom the local node is communicating
this is the key for this entry in the hashtablereqRange
- the pending range.public void updatePendingRange(rice.pastry.NodeId toNode, rice.pastry.IdRange reqRange, int numKeys)
toNode
- the node with whom the local node is communicating
this is the key for this entry in the hashtablereqRange
- the pending range.numKeys
- the expected number of keys associated with this subrangepublic void removePendingRange(rice.pastry.NodeId toNode, rice.pastry.IdRange reqRange)
toNode
- the node with whom the local node is communicating
this is the key for this entry in the hashtablereqRange
- the pending range.public void splitPendingRanges(rice.pastry.NodeId toNode)
toNode
- the node with which this local was communicating in
the keys exchange protocol.public java.util.Vector getPendingRanges(rice.pastry.NodeId toNode)
toNode
- the node with which this local was communicating in
the keys exchange protocol.public void printPendingRanges(rice.pastry.NodeId toNode)
toNode
- the node with which this local was communicating in
the keys exchange protocol.public void deliver(rice.pastry.Id key, rice.pastry.messaging.Message msg)
deliver
in class CommonAPIAppl
msg
- the message that is arriving.public void notifyReady()
notifyReady
in class CommonAPIAppl
public void periodicMaintenance()
public rice.pastry.security.Credentials getCredentials()
getCredentials
in class CommonAPIAppl
public void update(rice.pastry.NodeHandle nh, boolean wasAdded)
update
in class CommonAPIAppl
nh
- NodeHandle of the node which caused the neighborSet changewasAdded
- true if added, false if removedpublic void sendKeyRequestMessages(rice.pastry.NodeSet set, java.util.Vector rangeSet)
public void registerKey(rice.pastry.Id key)
registerKey
in interface RM
key
- the object identifierpublic void lookupForward(rice.pastry.routing.RouteMessage msg)
lookupForward
in interface RM
msg
- the RouteMessage
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |