|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.p2p.past.PastImpl rice.p2p.past.gc.GCPastImpl
public class GCPastImpl
Nested Class Summary | |
---|---|
protected class |
GCPastImpl.ReplicaMap
|
Nested classes/interfaces inherited from class rice.p2p.past.PastImpl |
---|
PastImpl.MessageBuilder |
Field Summary | |
---|---|
int |
collected
|
static long |
DEFAULT_EXPIRATION
The default expiration, or when objects inserted with no timeout will expire |
protected IdFactory |
realFactory
The real factory, which is not wrapped with a GCIdFactory |
int |
refreshed
|
Fields inherited from class rice.p2p.past.PastImpl |
---|
backup, endpoint, environment, factory, fetchHandles, inserts, instance, logger, lookups, MESSAGE_TIMEOUT, other, policy, replicaManager, replicationFactor, storage, SUCCESSFUL_INSERT_THRESHOLD, trash |
Fields inherited from interface rice.p2p.past.gc.GCPast |
---|
INFINITY_EXPIRATION |
Constructor Summary | |
---|---|
GCPastImpl(Node node,
StorageManager manager,
Cache backup,
int replicas,
java.lang.String instance,
PastPolicy policy,
long collectionInterval,
StorageManager trash)
Constructor for GCPast |
|
GCPastImpl(Node node,
StorageManager manager,
int replicas,
java.lang.String instance,
PastPolicy policy,
long collectionInterval)
Constructor for GCPast |
Method Summary | |
---|---|
protected void |
collect(java.util.SortedMap map,
Continuation command)
Internal method which collects all of the objects in the given set |
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 |
existsInOverlay(Id id,
Continuation command)
This upcall should return whether or not the given id is currently stored somewhere in the overlay by the client. |
void |
fetch(Id id,
NodeHandle hint,
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. |
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. |
void |
insert(PastContent obj,
Continuation command)
Inserts an object with the given ID into this instance of Past. |
void |
insert(PastContent obj,
long expiration,
Continuation command)
Inserts an object with the given ID into this instance of Past. |
protected void |
refresh(GCIdSet ids,
Continuation command)
Internal method which actually does the refreshing. |
void |
refresh(Id[] array,
long[] expirations,
Continuation command)
Updates the objects stored under the provided keys id to expire no earlier than the provided expiration time. |
void |
refresh(Id[] array,
long expiration,
Continuation command)
Updates the objects stored under the provided keys id to expire no earlier than the provided expiration time. |
void |
reInsert(Id id,
Continuation command)
Asks a client to reinsert an object it already holds into the overlay |
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()
This upcall should return the set of keys that the application currently stores. |
IdSet |
scan(IdRange range)
This upcall should return the set of keys that the application currently stores in this range. |
Methods inherited from class rice.p2p.past.PastImpl |
---|
buildReplicationManager, cache, doInsert, fetch, getEndpoint, getEnvironment, getHandles, getInstance, getLocalNodeHandle, getOutstandingMessages, getReplication, getReplicationFactor, getResponseContinuation, getStorageManager, getUID, lookup, lookup, lookupHandle, lookupHandles, sendRequest, sendRequest, sendRequest, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface rice.p2p.past.Past |
---|
fetch, getEnvironment, getInstance, getLocalNodeHandle, getReplicationFactor, lookup, lookup, lookupHandle, lookupHandles |
Field Detail |
---|
public static final long DEFAULT_EXPIRATION
protected IdFactory realFactory
public int collected
public int refreshed
Constructor Detail |
---|
public GCPastImpl(Node node, StorageManager manager, int replicas, java.lang.String instance, PastPolicy policy, long collectionInterval)
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 Pastpolicy
- The policy this past instance should usecollectionInterval
- The frequency with which GCPast should collection local expired objectspublic GCPastImpl(Node node, StorageManager manager, Cache backup, int replicas, java.lang.String instance, PastPolicy policy, long collectionInterval, StorageManager trash)
node
- The node below this Past implementationmanager
- The storage manager to be used by Pastbackup
- The cache used for previously-responsible objects (can be null)replicas
- The number of object replicasinstance
- The unique instance name of this Pasttrash
- The storage manager to place the deleted objects into (if null, they are removed)policy
- The policy this past instance should usecollectionInterval
- The frequency with which GCPast should collection local expired objectsMethod Detail |
---|
public void insert(PastContent obj, Continuation command)
insert
in interface GCPast
insert
in interface Past
insert
in class PastImpl
obj
- the object to be insertedcommand
- Command to be performed when the result is receivedpublic void insert(PastContent obj, long expiration, Continuation command)
insert
in interface GCPast
obj
- the object to be insertedexpiration
- the time until which the object must be storedcommand
- Command to be performed when the result is receivedpublic void refresh(Id[] array, long expiration, Continuation command)
refresh
in interface GCPast
id
- The keys which to refreshexpiration
- The time to extend the lifetime tocommand
- Command to be performed when the result is receivedpublic void refresh(Id[] array, long[] expirations, Continuation command)
refresh
in interface GCPast
id
- The keys which to refreshexpiration
- The time to extend the lifetime tocommand
- Command to be performed when the result is receivedprotected void refresh(GCIdSet ids, Continuation command)
ids
- The ids to refreshexpiration
- The time to extend the lifetime untilcommand
- The command to return the result topublic boolean forward(RouteMessage message)
forward
in interface Application
forward
in class PastImpl
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
deliver
in class PastImpl
id
- The destination id of the messagemessage
- The message being sentprotected void collect(java.util.SortedMap map, Continuation command)
set
- THe set to collectcommand
- The command to call once donepublic void fetch(Id id, NodeHandle hint, Continuation command)
fetch
in interface ReplicationManagerClient
fetch
in class PastImpl
id
- The id to fetchhint
- A hint where to find the key from. This is where the local node
heard about the key.command
- The command to return the result topublic void remove(Id id, Continuation command)
remove
in interface ReplicationManagerClient
remove
in class PastImpl
id
- The id to removepublic IdSet scan(IdRange range)
scan
in interface ReplicationManagerClient
scan
in class PastImpl
range
- the requested rangepublic IdSet scan()
scan
in class PastImpl
range
- the requested rangepublic boolean exists(Id id)
exists
in interface ReplicationManagerClient
exists
in class PastImpl
id
- The id in question
public void existsInOverlay(Id id, Continuation command)
ReplicationManagerClient
existsInOverlay
in interface ReplicationManagerClient
existsInOverlay
in class PastImpl
id
- The id in questionpublic void reInsert(Id id, Continuation command)
ReplicationManagerClient
reInsert
in interface ReplicationManagerClient
reInsert
in class PastImpl
id
- The id in question
|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |