|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.p2p.glacier.v2.GlacierImpl
public class GlacierImpl
Field Summary | |
---|---|
protected long |
bucketConsumed
|
protected long |
bucketLastUpdated
|
protected long |
bucketMax
|
protected long |
bucketMin
|
protected PastContentDeserializer |
contentDeserializer
|
protected PastContentHandleDeserializer |
contentHandleDeserializer
|
protected java.util.Hashtable |
continuations
|
protected long |
currentFragmentRequestTimeout
|
protected Endpoint |
endpoint
|
protected IdFactory |
factory
|
protected StorageManager |
fragmentStorage
|
protected java.lang.String |
instance
|
protected java.util.Vector |
listeners
|
protected Logger |
logger
|
protected StorageManager |
neighborStorage
|
protected long |
nextContinuationTimeout
|
protected int |
nextUID
|
protected Node |
node
|
protected int |
numFragments
|
protected int |
numSurvivors
|
protected java.util.Hashtable |
pendingTraffic
|
protected GlacierPolicy |
policy
|
protected IdRange |
responsibleRange
|
protected GlacierStatistics |
statistics
|
protected CancellableTask |
timer
|
protected long |
tokenBucket
|
protected StorageManager |
trashStorage
|
Fields inherited from interface rice.p2p.past.gc.GCPast |
---|
INFINITY_EXPIRATION |
Constructor Summary | |
---|---|
GlacierImpl(Node nodeArg,
StorageManager fragmentStorageArg,
StorageManager neighborStorageArg,
int numFragmentsArg,
int numSurvivorsArg,
IdFactory factoryArg,
java.lang.String instanceArg,
GlacierPolicy policyArg)
|
Method Summary | |
---|---|
void |
addStatisticsListener(GlacierStatisticsListener gsl)
|
void |
deliver(Id id,
Message message)
This method is called on the application at the destination node for the given id. |
void |
emptyTrash(Continuation c)
|
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. |
Environment |
getEnvironment()
|
java.lang.String |
getInstance()
|
NodeHandle |
getLocalNodeHandle()
get the nodeHandle of the local Past node |
Id[][] |
getNeighborRanges()
|
int |
getReplicationFactor()
Returns the number of replicas used in this Past |
long |
getTrashSize()
|
protected int |
getUID()
|
java.lang.String |
handleDebugCommand(java.lang.String command)
|
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. |
void |
lookup(Id id,
boolean cache,
Continuation command)
Retrieves the object stored in this instance of Past with the given ID. |
void |
lookup(Id id,
Continuation command)
Retrieves the object stored in this instance of Past with the given ID. |
void |
lookup(Id id,
long version,
Continuation command)
Retrieves the object stored in this instance of Past with the given ID and the specified version. |
void |
lookupHandle(Id id,
NodeHandle handle,
Continuation command)
Retrieves the handle for the given object stored on the requested node. |
void |
lookupHandles(Id id,
int num,
Continuation command)
Retrieves the handles of up to max replicas of the object stored in this instance of Past with the given ID. |
void |
lookupHandles(Id id,
long version,
int num,
Continuation command)
Retrieves the handles of up to max replicas of the object stored in this instance of Past with the given ID. |
void |
neighborSeen(Id nodeId,
long when)
|
void |
rateLimitedRetrieveFragment(FragmentKey key,
Manifest manifest,
char tag,
GlacierContinuation c)
|
void |
refresh(Id[] ids,
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[] ids,
long[] versions,
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[] ids,
long expiration,
Continuation command)
Updates the objects stored under the provided keys id to expire no earlier than the provided expiration time. |
void |
removeStatisticsListener(GlacierStatisticsListener gsl)
|
void |
retrieveFragment(FragmentKey key,
Manifest manifest,
char tag,
GlacierContinuation c)
|
void |
retrieveManifest(VersionKey key,
char tag,
Continuation command)
|
void |
retrieveObject(VersionKey key,
Manifest manifest,
boolean beStrict,
char tag,
Continuation c)
|
void |
sendMessage(Id id,
GlacierMessage message,
NodeHandle hint)
|
void |
setBandwidthLimit(long bytesPerSecond,
long maxBurst)
|
void |
setContentDeserializer(PastContentDeserializer deserializer)
|
void |
setContentHandleDeserializer(PastContentHandleDeserializer deserializer)
|
void |
setNeighborTimeout(long neighborTimeoutMin)
|
void |
setRateLimit(int rps)
|
void |
setSyncInterval(int syncIntervalSec)
|
void |
setSyncMaxFragments(int syncMaxFragments)
|
void |
setTrashcan(StorageManager trashStorage)
|
void |
startup()
|
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. |
protected void |
updateTokenBucket()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final StorageManager fragmentStorage
protected final StorageManager neighborStorage
protected final GlacierPolicy policy
protected final Node node
protected final int numFragments
protected final java.lang.String instance
protected final int numSurvivors
protected final Endpoint endpoint
protected final IdFactory factory
protected final java.util.Hashtable continuations
protected final java.util.Hashtable pendingTraffic
protected StorageManager trashStorage
protected long nextContinuationTimeout
protected IdRange responsibleRange
protected int nextUID
protected CancellableTask timer
protected GlacierStatistics statistics
protected java.util.Vector listeners
protected long currentFragmentRequestTimeout
protected long tokenBucket
protected long bucketLastUpdated
protected long bucketMin
protected long bucketMax
protected long bucketConsumed
protected Logger logger
protected PastContentDeserializer contentDeserializer
protected PastContentHandleDeserializer contentHandleDeserializer
Constructor Detail |
---|
public GlacierImpl(Node nodeArg, StorageManager fragmentStorageArg, StorageManager neighborStorageArg, int numFragmentsArg, int numSurvivorsArg, IdFactory factoryArg, java.lang.String instanceArg, GlacierPolicy policyArg)
Method Detail |
---|
public void startup()
protected void updateTokenBucket()
public void sendMessage(Id id, GlacierMessage message, NodeHandle hint)
public void setTrashcan(StorageManager trashStorage)
protected int getUID()
public java.lang.String handleDebugCommand(java.lang.String command)
handleDebugCommand
in interface DebugCommandHandler
public void insert(PastContent obj, Continuation command)
GCPast
insert
in interface GCPast
insert
in interface Past
obj
- the object to be insertedcommand
- Command to be performed when the result is receivedpublic void refresh(Id[] ids, long[] expirations, Continuation command)
GCPast
refresh
in interface GCPast
expirations
- The time to extend the lifetime tocommand
- Command to be performed when the result is receivedpublic void refresh(Id[] ids, long expiration, Continuation command)
GCPast
refresh
in interface GCPast
expiration
- The time to extend the lifetime to (applies to all keys)command
- Command to be performed when the result is receivedpublic void refresh(Id[] ids, long[] versions, long[] expirations, Continuation command)
VersioningPast
refresh
in interface VersioningPast
command
- Command to be performed when the result is receivedpublic void insert(PastContent obj, long expiration, Continuation command)
GCPast
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 neighborSeen(Id nodeId, long when)
public boolean forward(RouteMessage message)
Application
forward
in interface Application
message
- The message being sent, containing an internal message
along with a destination key and nodeHandle next hop.
public void update(NodeHandle handle, boolean joined)
Application
update
in interface Application
handle
- The handle that has joined/leftjoined
- Whether the node has joined or leftpublic void lookupHandle(Id id, NodeHandle handle, Continuation command)
Past
lookupHandle
in interface Past
id
- the key to be queriedhandle
- The node on which the handle is requestedcommand
- Command to be performed when the result is receivedpublic void lookupHandles(Id id, int num, Continuation command)
Past
lookupHandles
in interface Past
id
- the key to be queriednum
- the maximal number of replicas requestedcommand
- Command to be performed when the result is receivedpublic void lookupHandles(Id id, long version, int num, Continuation command)
VersioningPast
lookupHandles
in interface VersioningPast
id
- the key to be queriedversion
- the requested versioncommand
- Command to be performed when the result is receivedpublic void lookup(Id id, long version, Continuation command)
VersioningPast
lookup
in interface VersioningPast
id
- the key to be queriedcommand
- Command to be performed when the result is receivedpublic void lookup(Id id, boolean cache, Continuation command)
Past
lookup
in interface Past
id
- the key to be queriedcache
- Whether or not the result should be cachedcommand
- Command to be performed when the result is receivedpublic void lookup(Id id, Continuation command)
Past
lookup
in interface Past
id
- the key to be queriedcommand
- Command to be performed when the result is receivedpublic void fetch(PastContentHandle handle, Continuation command)
Past
fetch
in interface Past
handle
- the key to be queriedcommand
- Command to be performed when the result is receivedpublic void retrieveManifest(VersionKey key, char tag, Continuation command)
public void retrieveObject(VersionKey key, Manifest manifest, boolean beStrict, char tag, Continuation c)
public void retrieveFragment(FragmentKey key, Manifest manifest, char tag, GlacierContinuation c)
public void rateLimitedRetrieveFragment(FragmentKey key, Manifest manifest, char tag, GlacierContinuation c)
public Id[][] getNeighborRanges()
public void deliver(Id id, Message message)
Application
deliver
in interface Application
id
- The destination id of the messagemessage
- The message being sentpublic int getReplicationFactor()
Past
getReplicationFactor
in interface Past
public NodeHandle getLocalNodeHandle()
Past
getLocalNodeHandle
in interface Past
public void setSyncInterval(int syncIntervalSec)
public void setSyncMaxFragments(int syncMaxFragments)
public void setRateLimit(int rps)
public void setNeighborTimeout(long neighborTimeoutMin)
public void setBandwidthLimit(long bytesPerSecond, long maxBurst)
public long getTrashSize()
public void emptyTrash(Continuation c)
public void addStatisticsListener(GlacierStatisticsListener gsl)
public void removeStatisticsListener(GlacierStatisticsListener gsl)
public Environment getEnvironment()
getEnvironment
in interface Past
public java.lang.String getInstance()
getInstance
in interface Past
public void setContentDeserializer(PastContentDeserializer deserializer)
setContentDeserializer
in interface Past
public void setContentHandleDeserializer(PastContentHandleDeserializer deserializer)
setContentHandleDeserializer
in interface Past
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |