|
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 rice.p2p.past.gc.GCPastImpl
Nested Class Summary | |
protected class |
GCPastImpl.GCPastDeserializer
DESCRIBE THE CLASS |
protected class |
GCPastImpl.ReplicaMap
DESCRIBE THE CLASS |
Nested classes inherited from class rice.p2p.past.PastImpl |
PastImpl.MessageBuilder, PastImpl.PastDeserializer |
Field Summary | |
int |
collected
DESCRIBE THE FIELD |
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
DESCRIBE THE FIELD |
Fields inherited from class rice.p2p.past.PastImpl |
backup, contentDeserializer, contentHandleDeserializer, endpoint, environment, factory, fetchHandles, inserts, instance, logger, lookups, MESSAGE_TIMEOUT, other, policy, replicaManager, replicationFactor, socketStrategy, 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)
DESCRIBE THE METHOD |
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)
DESCRIBE THE METHOD |
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. |
java.lang.String |
toString()
DESCRIBE THE METHOD |
Methods inherited from class rice.p2p.past.PastImpl |
buildReplicationManager, cache, doInsert, fetch, getEndpoint, getEnvironment, getFetchResponseContinuation, getHandles, getInstance, getLocalNodeHandle, getOutstandingMessages, getReplication, getReplicationFactor, getResponseContinuation, getStorageManager, getUID, lookup, lookup, lookupHandle, lookupHandles, sendRequest, sendRequest, sendRequest, setContentDeserializer, setContentHandleDeserializer, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface rice.p2p.past.Past |
fetch, getEnvironment, getInstance, getLocalNodeHandle, getReplicationFactor, lookup, lookup, lookupHandle, lookupHandles, setContentDeserializer, setContentHandleDeserializer |
Field Detail |
protected IdFactory realFactory
public int collected
public int refreshed
public static final long DEFAULT_EXPIRATION
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 java.lang.String toString()
toString
in class PastImpl
public void insert(PastContent obj, Continuation command)
insert
in interface GCPast
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
expiration
- The time to extend the lifetime tocommand
- Command to be performed when the result is receivedarray
- DESCRIBE THE PARAMETERpublic void refresh(Id[] array, long[] expirations, Continuation command)
refresh
in interface GCPast
command
- Command to be performed when the result is receivedarray
- DESCRIBE THE PARAMETERexpirations
- DESCRIBE THE PARAMETERprotected void refresh(GCIdSet ids, Continuation command)
ids
- The ids to refreshcommand
- 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)
command
- The command to call once donemap
- DESCRIBE THE PARAMETERpublic void fetch(Id id, NodeHandle hint, Continuation command)
fetch
in interface ReplicationManagerClient
fetch
in class PastImpl
id
- The id to fetchhint
- DESCRIBE THE PARAMETERcommand
- DESCRIBE THE PARAMETERpublic void remove(Id id, Continuation command)
remove
in interface ReplicationManagerClient
remove
in class PastImpl
id
- The id to removecommand
- DESCRIBE THE PARAMETERpublic IdSet scan(IdRange range)
scan
in interface ReplicationManagerClient
scan
in class PastImpl
range
- the requested range
public IdSet scan()
scan
in class PastImpl
public boolean exists(Id id)
exists
in interface ReplicationManagerClient
exists
in class PastImpl
id
- The id in question
public void existsInOverlay(Id id, Continuation command)
existsInOverlay
in interface ReplicationManagerClient
existsInOverlay
in class PastImpl
id
- DESCRIBE THE PARAMETERcommand
- DESCRIBE THE PARAMETERpublic void reInsert(Id id, Continuation command)
reInsert
in interface ReplicationManagerClient
reInsert
in class PastImpl
id
- DESCRIBE THE PARAMETERcommand
- DESCRIBE THE PARAMETER
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |