|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrice.p2p.past.PastImpl
Field Summary | |
protected Endpoint |
endpoint
|
protected IdFactory |
factory
|
protected java.util.logging.Logger |
log
|
static int |
MESSAGE_TIMEOUT
|
protected ReplicationManagerImpl |
replicaManager
|
protected int |
replicationFactor
|
protected StorageManager |
storage
|
Constructor Summary | |
PastImpl(Node node,
StorageManager manager,
int replicas,
java.lang.String instance)
Constructor for Past |
Method Summary | |
void |
deliver(Id id,
Message message)
This method is called on the application at the destination node for the given id. |
boolean |
exists(Id id)
This upcall should return whether or not the given id is currently stored by the client. |
void |
fetch(Id id,
Continuation command)
This upcall is invoked to tell the client to fetch the given id, and to call the given command with the boolean result once the fetch is completed. |
void |
fetch(PastContentHandle handle,
Continuation command)
Retrieves the object associated with a given content handle. |
boolean |
forward(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. |
NodeHandle |
getLocalNodeHandle()
get the nodeHandle of the local Past node |
Replication |
getReplicaManager()
Returns the replica manager for this Past instance. |
int |
getReplicationFactor()
Returns the number of replicas used in this Past |
StorageManager |
getStorageManager()
Returns this Past's storage manager. |
void |
insert(PastContent obj,
Continuation command)
Inserts an object with the given ID into this instance of Past. |
void |
lookup(Id id,
Continuation command)
Retrieves the object stored in this instance of Past with the given ID. |
void |
lookupHandles(Id id,
int max,
Continuation command)
Retrieves the handles of up to max replicas of the object stored in this instance of Past with the given ID. |
void |
remove(Id id,
Continuation command)
This upcall is to notify the client that the given id can be safely removed from the storage. |
IdSet |
scan(IdRange range)
This upcall should return the set of keys that the application currently stores in this range. |
void |
update(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 Endpoint endpoint
protected StorageManager storage
protected int replicationFactor
protected ReplicationManagerImpl replicaManager
protected IdFactory factory
protected java.util.logging.Logger log
Constructor Detail |
public PastImpl(Node node, 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(PastContent obj, Continuation command)
insert
in interface Past
obj
- the object to be insertedcommand
- Command to be performed when the result is receivedpublic void lookup(Id id, Continuation command)
lookup
in interface Past
id
- the key to be queriedcommand
- Command to be performed when the result is receivedpublic void lookupHandles(Id id, int max, 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(PastContentHandle handle, Continuation command)
fetch
in interface Past
command
- Command to be performed when the result is receivedhandle
- the key to be queriedpublic NodeHandle getLocalNodeHandle()
getLocalNodeHandle
in interface Past
public int getReplicationFactor()
getReplicationFactor
in interface Past
public boolean forward(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(Id id, Message message)
deliver
in interface Application
id
- The destination id of the messagemessage
- The message being sentpublic void update(NodeHandle handle, boolean joined)
update
in interface Application
handle
- The handle that has joined/leftjoined
- Whether the node has joined or leftpublic void fetch(Id id, Continuation command)
fetch
in interface ReplicationManagerClient
id
- The id to fetchpublic void remove(Id id, Continuation command)
remove
in interface ReplicationManagerClient
id
- The id to removepublic IdSet scan(IdRange range)
scan
in interface Past
range
- the requested range
public boolean exists(Id id)
exists
in interface ReplicationManagerClient
id
- The id in question
public Replication getReplicaManager()
public StorageManager getStorageManager()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |