| 
Rice Pastry API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectrice.p2p.replication.manager.ReplicationManagerImpl
| Nested Class Summary | |
protected  class | 
ReplicationManagerImpl.ReplicationManagerDeleter
Inner class which keeps track of the keys which we are currently deleting  | 
protected  class | 
ReplicationManagerImpl.ReplicationManagerHelper
Inner class which keeps track of the state we're in- waiting, sleeping, or with nothing to do.  | 
| Field Summary | |
protected  ReplicationManagerClient | 
client
The client of this manager  | 
protected  ReplicationManagerImpl.ReplicationManagerDeleter | 
deleter
The deleter, for managing ids to delete  | 
protected  Endpoint | 
endpoint
The endpoint used for sending reminder messages  | 
protected  IdFactory | 
factory
The id factory used for manipulating ids  | 
static int | 
FETCH_DELAY
The amount of time to wait between fetch calls to the client  | 
protected  ReplicationManagerImpl.ReplicationManagerHelper | 
helper
The helper for the replication manager  | 
protected  java.lang.String | 
instance
DESCRIBE THE FIELD  | 
protected  java.util.logging.Logger | 
log
the logger which we will use  | 
static int | 
NUM_DELETE_AT_ONCE
The number of ids to delete at a given time - others will be deleted later  | 
protected  ReplicationImpl | 
replication
The replication used by the manager  | 
static int | 
TIMEOUT_DELAY
The amount of time to wait before giving up on a client fetch  | 
| Constructor Summary | |
ReplicationManagerImpl(Node node,
                       ReplicationManagerClient client,
                       int replicationFactor,
                       java.lang.String instance)
Constructor  | 
|
ReplicationManagerImpl(Node node,
                       ReplicationManagerClient client,
                       int replicationFactor,
                       java.lang.String instance,
                       ReplicationPolicy policy)
Constructor  | 
|
| Method Summary | |
protected  IdSet | 
clone(IdSet keySet)
Internal method which clones an IdSet, so that iterators work as expected  | 
 void | 
deliver(Id id,
        Message message)
This method is called on the application at the destination node for the given id.  | 
 void | 
fetch(IdSet keySet,
      NodeHandle hint)
This upcall is invoked to notify the application that is should fetch the cooresponding keys in this set, since the node is now responsible for these keys also.  | 
 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.  | 
 Replication | 
getReplication()
Utility method which returns the underlying replication object.  | 
protected  void | 
informClient(Id id,
             NodeHandle hint)
Internal method which informs the client of the next id to fetch  | 
 IdSet | 
scan(IdRange range)
This upcall should return the set of keys that the application currently stores in this range.  | 
protected  void | 
scheduleNext()
Internal method which schedules the next reminder message (if it is necessary), or simply resets the active flag if there's nothing to be fetched.  | 
 void | 
setRange(IdRange range)
This upcall is to notify the application of the range of keys for which it is responsible.  | 
 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 | 
protected IdFactory factory
protected Endpoint endpoint
protected ReplicationImpl replication
protected ReplicationManagerClient client
protected ReplicationManagerImpl.ReplicationManagerHelper helper
protected ReplicationManagerImpl.ReplicationManagerDeleter deleter
protected java.util.logging.Logger log
protected java.lang.String instance
public static int FETCH_DELAY
public static int TIMEOUT_DELAY
public static int NUM_DELETE_AT_ONCE
| Constructor Detail | 
public ReplicationManagerImpl(Node node,
                              ReplicationManagerClient 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 Replication
public ReplicationManagerImpl(Node node,
                              ReplicationManagerClient 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 Replicationpolicy - The replication policy to use| Method Detail | 
public Replication getReplication()
getReplication in interface ReplicationManagerpublic void setRange(IdRange range)
setRange in interface ReplicationClientrange - the range of keys for which the local node is currently
      responsibleprotected IdSet clone(IdSet keySet)
keySet - The set to clone
protected void informClient(Id id,
                            NodeHandle hint)
id - The id which the client should fetchhint - The hint where the id may beprotected void scheduleNext()
public void fetch(IdSet keySet,
                  NodeHandle hint)
fetch in interface ReplicationClientkeySet - set containing the keys that needs to be fetchedhint - DESCRIBE THE PARAMETERpublic IdSet scan(IdRange range)
scan in interface ReplicationClientrange - the requested range
public boolean forward(RouteMessage message)
forward in interface Applicationmessage - 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 Applicationid - The destination id of the messagemessage - The message being sent
public void update(NodeHandle handle,
                   boolean joined)
update in interface Applicationhandle - The handle that has joined/leftjoined - Whether the node has joined or left
  | 
Rice Pastry API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||