|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrice.p2p.past.PastImpl
rice.p2p.past.gc.GCPastImpl
public class GCPastImpl
| Nested Class Summary | |
|---|---|
protected class |
GCPastImpl.GCPastDeserializer
|
protected class |
GCPastImpl.ReplicaMap
|
| Nested classes/interfaces inherited from class rice.p2p.past.PastImpl |
|---|
PastImpl.MessageBuilder, PastImpl.PastDeserializer |
| 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, contentDeserializer, contentHandleDeserializer, endpoint, environment, factory, fetchHandles, inserts, instance, lockManager, 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)
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. |
java.lang.String |
toString()
|
| 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 |
|---|
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 objects
public 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 objects| Method Detail |
|---|
public java.lang.String toString()
toString in class PastImpl
public void insert(PastContent obj,
Continuation command)
insert in interface GCPastinsert in interface Pastinsert in class PastImplobj - the object to be insertedcommand - Command to be performed when the result is received
public void insert(PastContent obj,
long expiration,
Continuation command)
insert in interface GCPastobj - the object to be insertedexpiration - the time until which the object must be storedcommand - Command to be performed when the result is received
public void refresh(Id[] array,
long expiration,
Continuation command)
refresh in interface GCPastid - The keys which to refreshexpiration - The time to extend the lifetime tocommand - Command to be performed when the result is received
public void refresh(Id[] array,
long[] expirations,
Continuation command)
refresh in interface GCPastid - The keys which to refreshexpiration - The time to extend the lifetime tocommand - Command to be performed when the result is received
protected 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 Applicationforward in class PastImplmessage - 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 Applicationdeliver in class PastImplid - The destination id of the messagemessage - The message being sent
protected void collect(java.util.SortedMap map,
Continuation command)
set - THe set to collectcommand - The command to call once done
public void fetch(Id id,
NodeHandle hint,
Continuation command)
fetch in interface ReplicationManagerClientfetch in class PastImplid - 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 to
public void remove(Id id,
Continuation command)
remove in interface ReplicationManagerClientremove in class PastImplid - The id to removepublic IdSet scan(IdRange range)
scan in interface ReplicationManagerClientscan in class PastImplrange - the requested rangepublic IdSet scan()
scan in class PastImplrange - the requested rangepublic boolean exists(Id id)
exists in interface ReplicationManagerClientexists in class PastImplid - The id in question
public void existsInOverlay(Id id,
Continuation command)
ReplicationManagerClient
existsInOverlay in interface ReplicationManagerClientexistsInOverlay in class PastImplid - The id in question
public void reInsert(Id id,
Continuation command)
ReplicationManagerClient
reInsert in interface ReplicationManagerClientreInsert in class PastImplid - The id in question
|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||