|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrice.pastry.PastryNodeFactory
public abstract class PastryNodeFactory
The interface to an object which can construct PastryNodes.
| Field Summary | |
|---|---|
protected Environment |
environment
|
protected Logger |
logger
|
protected byte |
lSetSize
|
protected java.util.Hashtable<NodeHandle,java.util.Hashtable<NodeHandle,java.lang.Integer>> |
pingCache
Hashtable which keeps track of temporary ping values, which are only used during the getNearest() method |
protected byte |
rtBase
|
protected byte |
rtMax
|
| Constructor Summary | |
|---|---|
PastryNodeFactory(Environment env)
|
|
| Method Summary | |
|---|---|
Environment |
getEnvironment()
|
abstract LeafSet |
getLeafSet(NodeHandle handle)
This method returns the remote leafset of the provided handle to the caller, in a protocol-dependent fashion. |
abstract CancellableTask |
getLeafSet(NodeHandle handle,
Continuation c)
Non-blocking version. |
NodeHandle[] |
getNearest(NodeHandle local,
NodeHandle seed)
This method implements the algorithm in the Pastry locality paper for finding a close node the the current node through iterative leafset and route row requests. |
abstract int |
getProximity(NodeHandle local,
NodeHandle handle)
This method determines and returns the proximity of the current local node the provided NodeHandle. |
abstract RouteSet[] |
getRouteRow(NodeHandle handle,
int row)
This method returns the remote route row of the provided handle to the caller, in a protocol-dependent fashion. |
abstract CancellableTask |
getRouteRow(NodeHandle handle,
int row,
Continuation c)
Non-blocking version. |
abstract PastryNode |
newNode(NodeHandle bootstrap)
Call this to construct a new node of the type chosen by the factory. |
abstract PastryNode |
newNode(NodeHandle bootstrap,
Id nodeId)
Call this to construct a new node of the type chosen by the factory, with the given nodeId. |
protected int |
proximity(NodeHandle local,
NodeHandle handle)
Method which checks to see if we have a cached value of the remote ping, and if not, initiates a ping and then caches the value |
NodeHandle[] |
sortedProximityCache(NodeHandle local)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final byte rtMax
protected final byte lSetSize
protected final byte rtBase
protected java.util.Hashtable<NodeHandle,java.util.Hashtable<NodeHandle,java.lang.Integer>> pingCache
protected Environment environment
protected Logger logger
| Constructor Detail |
|---|
public PastryNodeFactory(Environment env)
| Method Detail |
|---|
public abstract PastryNode newNode(NodeHandle bootstrap)
bootstrap - The node handle to bootstrap off of
public abstract PastryNode newNode(NodeHandle bootstrap,
Id nodeId)
bootstrap - The node handle to bootstrap off ofnodeId - The nodeId of the new node
public abstract LeafSet getLeafSet(NodeHandle handle)
throws java.io.IOException
handle - The node to connect to
java.io.IOException
public abstract CancellableTask getLeafSet(NodeHandle handle,
Continuation c)
handle - c -
java.io.IOException
public abstract RouteSet[] getRouteRow(NodeHandle handle,
int row)
throws java.io.IOException
handle - The node to connect torow - The row number to retrieve
java.io.IOException
public abstract CancellableTask getRouteRow(NodeHandle handle,
int row,
Continuation c)
handle - row - c -
java.io.IOException
public abstract int getProximity(NodeHandle local,
NodeHandle handle)
handle - The handle to determine the proximity of
public Environment getEnvironment()
protected int proximity(NodeHandle local,
NodeHandle handle)
handle - The handle to ping
public NodeHandle[] sortedProximityCache(NodeHandle local)
public NodeHandle[] getNearest(NodeHandle local,
NodeHandle seed)
seed - Any member of the pastry ring
|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||