|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.p2p.replication.ReplicationImpl
public class ReplicationImpl
Nested Class Summary | |
---|---|
protected class |
ReplicationImpl.BloomFilterExecutable
Internal class which is an executable for creating a bloom filter |
Field Summary | |
---|---|
protected ReplicationClient |
client
This replication's client |
protected boolean |
destroyed
|
protected Endpoint |
endpoint
this application's endpoint |
protected IdFactory |
factory
The factory for create IdSets and IdRanges |
protected NodeHandle |
handle
the local node handle |
protected java.lang.String |
instance
The instance name of the replication |
int |
MAINTENANCE_INTERVAL
The amount of time to wait between replications |
int |
MAX_KEYS_IN_MESSAGE
The maximum number of keys to return in one message |
protected ReplicationPolicy |
policy
This replication's policy, which allows for application-specific replication |
protected int |
replicationFactor
The replication factor for this replication |
Constructor Summary | |
---|---|
ReplicationImpl(Node node,
ReplicationClient client,
int replicationFactor,
java.lang.String instance)
Constructor |
|
ReplicationImpl(Node node,
ReplicationClient client,
int replicationFactor,
java.lang.String instance,
ReplicationPolicy policy)
Constructor |
Method Summary | |
---|---|
void |
deliver(Id id,
Message message)
This method is called on the application at the destination node for the given id. |
void |
destroy()
|
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. |
protected IdRange |
getTotalRange()
Returns the range for which the local node is an i root, where i can range between 0 and replicationFactor can return null if the range can't be determined |
static IdSet |
merge(IdFactory factory,
IdSet a,
IdSet b)
Internal method which takes returns set A + set B, or all of the members of set A and set B. |
void |
replicate()
This internal method sends out the request messages to all of the nodes which hold keys this node may be interested in |
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 final int MAINTENANCE_INTERVAL
public final int MAX_KEYS_IN_MESSAGE
protected Endpoint endpoint
protected NodeHandle handle
protected IdFactory factory
protected ReplicationClient client
protected ReplicationPolicy policy
protected int replicationFactor
protected java.lang.String instance
protected boolean destroyed
Constructor Detail |
---|
public ReplicationImpl(Node node, ReplicationClient client, int replicationFactor, java.lang.String instance)
node
- The node below this Replication implementationclient
- The client for this ReplicationreplicationFactor
- The replication factor for this instanceinstance
- The unique instance name of this Replicationpublic ReplicationImpl(Node node, ReplicationClient client, int replicationFactor, java.lang.String instance, ReplicationPolicy policy)
node
- The node below this Replication implementationclient
- The client for this ReplicationreplicationFactor
- The replication factor for this instanceinstance
- The unique instance name of this ReplicationMethod Detail |
---|
public static IdSet merge(IdFactory factory, IdSet a, IdSet b)
a
- The first setb
- The second set
protected IdRange getTotalRange()
public void replicate()
replicate
in interface Replication
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 destroy()
destroy
in interface Destructable
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |