|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--rice.p2p.past.PastImpl
Field Summary | |
protected rice.p2p.commonapi.Endpoint |
endpoint
|
protected rice.p2p.commonapi.IdFactory |
factory
|
protected java.util.logging.Logger |
log
|
static int |
MESSAGE_TIMEOUT
|
protected rice.p2p.commonapi.IdSet |
pending
|
protected rice.rm.RM |
replicaManager
|
protected int |
replicationFactor
|
protected rice.persistence.StorageManager |
storage
|
Constructor Summary | |
PastImpl(rice.p2p.commonapi.Node node,
rice.persistence.StorageManager manager,
int replicas,
java.lang.String instance)
Constructor for Past |
Method Summary | |
void |
deliver(rice.p2p.commonapi.Id id,
rice.p2p.commonapi.Message message)
This method is called on the application at the destination node for the given id. |
void |
fetch(rice.pastry.IdSet keySet)
This upcall is invoked to notify the application that is should fetch the cooresponding keys in this set, since the node is now responsible for these keys also. |
void |
fetch(rice.p2p.past.PastContentHandle handle,
rice.Continuation command)
Retrieves the object associated with a given content handle. |
boolean |
forward(rice.p2p.commonapi.RouteMessage message)
This method is invoked on applications when the underlying node is about to forward the given message with the provided target to the specified next hop. |
rice.p2p.commonapi.NodeHandle |
getLocalNodeHandle()
get the nodeHandle of the local Past node |
rice.rm.RM |
getReplicaManager()
Returns the replica manager for this Past instance. |
int |
getReplicationFactor()
Returns the number of replicas used in this Past |
rice.persistence.StorageManager |
getStorageManager()
Returns this Past's storage manager. |
void |
insert(rice.p2p.past.PastContent obj,
rice.Continuation command)
Inserts an object with the given ID into this instance of Past. |
void |
isResponsible(rice.pastry.IdRange range)
This upcall is to notify the application of the range of keys for which it is responsible. |
void |
lookup(rice.p2p.commonapi.Id id,
rice.Continuation command)
Retrieves the object stored in this instance of Past with the given ID. |
void |
lookupHandles(rice.p2p.commonapi.Id id,
int max,
rice.Continuation command)
Retrieves the handles of up to max replicas of the object stored in this instance of Past with the given ID. |
void |
rmIsReady(rice.rm.RM rm)
This upcall is simply to denote that the underlying replica manager (rm) is ready. |
rice.p2p.commonapi.IdSet |
scan(rice.p2p.commonapi.IdRange range)
Return the ids of objects stored in this instance of Past on the *local* node, with ids in a given range. |
rice.pastry.IdSet |
scan(rice.pastry.IdRange range)
This upcall should return the set of keys that the application currently stores in this range. |
void |
update(rice.p2p.commonapi.NodeHandle handle,
boolean joined)
This method is invoked to inform the application that the given node has either joined or left the neighbor set of the local node, as the set would be returned by the neighborSet call. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int MESSAGE_TIMEOUT
protected rice.p2p.commonapi.Endpoint endpoint
protected rice.persistence.StorageManager storage
protected int replicationFactor
protected rice.rm.RM replicaManager
protected rice.p2p.commonapi.IdFactory factory
protected rice.p2p.commonapi.IdSet pending
protected java.util.logging.Logger log
Constructor Detail |
public PastImpl(rice.p2p.commonapi.Node node, rice.persistence.StorageManager manager, int replicas, java.lang.String instance)
node
- The node below this Past implementationmanager
- The storage manager to be used by Pastreplicas
- The number of object replicasinstance
- The unique instance name of this PastMethod Detail |
public void insert(rice.p2p.past.PastContent obj, rice.Continuation command)
insert
in interface Past
obj
- the object to be insertedcommand
- Command to be performed when the result is receivedpublic void lookup(rice.p2p.commonapi.Id id, rice.Continuation command)
lookup
in interface Past
id
- the key to be queriedcommand
- Command to be performed when the result is receivedpublic void lookupHandles(rice.p2p.commonapi.Id id, int max, rice.Continuation command)
lookupHandles
in interface Past
id
- the key to be queriedmax
- the maximal number of replicas requestedcommand
- Command to be performed when the result is receivedpublic void fetch(rice.p2p.past.PastContentHandle handle, rice.Continuation command)
fetch
in interface Past
command
- Command to be performed when the result is receivedhandle
- the key to be queriedpublic rice.p2p.commonapi.IdSet scan(rice.p2p.commonapi.IdRange range)
scan
in interface Past
range
- The range to query
public rice.p2p.commonapi.NodeHandle getLocalNodeHandle()
getLocalNodeHandle
in interface Past
public int getReplicationFactor()
getReplicationFactor
in interface Past
public boolean forward(rice.p2p.commonapi.RouteMessage message)
forward
in interface Application
message
- The message being sent, containing an internal message
along with a destination key and nodeHandle next hop.
public void deliver(rice.p2p.commonapi.Id id, rice.p2p.commonapi.Message message)
deliver
in interface Application
id
- The destination id of the messagemessage
- The message being sentpublic void update(rice.p2p.commonapi.NodeHandle handle, boolean joined)
update
in interface Application
handle
- The handle that has joined/leftjoined
- Whether the node has joined or leftpublic void fetch(rice.pastry.IdSet keySet)
fetch
in interface RMClient
keySet
- set containing the keys that needs to be fetchedpublic void rmIsReady(rice.rm.RM rm)
rmIsReady
in interface RMClient
rm
- the instance of the Replica Managerpublic void isResponsible(rice.pastry.IdRange range)
isResponsible
in interface RMClient
range
- the range of keys for which the local node is currently
responsiblepublic rice.pastry.IdSet scan(rice.pastry.IdRange range)
scan
in interface RMClient
range
- the requested rangepublic rice.rm.RM getReplicaManager()
public rice.persistence.StorageManager getStorageManager()
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |