Rice Pastry API

rice.pastry
Class PastryNodeFactory

java.lang.Object
  |
  +--rice.pastry.PastryNodeFactory
Direct Known Subclasses:
DirectPastryNodeFactory, DistPastryNodeFactory, MultiRingPastryNodeFactory

public abstract class PastryNodeFactory
extends java.lang.Object

The interface to an object which can construct PastryNodes.

Version:
$Id: PastryNodeFactory.java,v 1.9 2003/09/27 02:49:47 amislove Exp $
Author:
Andrew Ladd, Alan Mislove, Merziyah Poonawala, Abhishek Ray

Constructor Summary
PastryNodeFactory()
           
 
Method Summary
abstract  rice.pastry.leafset.LeafSet getLeafSet(rice.pastry.NodeHandle handle)
          This method returns the remote leafset of the provided handle to the caller, in a protocol-dependent fashion.
 rice.pastry.NodeHandle getNearest(rice.pastry.NodeHandle local, rice.pastry.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(rice.pastry.NodeHandle local, rice.pastry.NodeHandle handle)
          This method determines and returns the proximity of the current local node the provided NodeHandle.
abstract  rice.pastry.routing.RouteSet[] getRouteRow(rice.pastry.NodeHandle handle, int row)
          This method returns the remote route row of the provided handle to the caller, in a protocol-dependent fashion.
abstract  rice.pastry.PastryNode newNode(rice.pastry.NodeHandle bootstrap)
          Call this to construct a new node of the type chosen by the factory.
abstract  rice.pastry.PastryNode newNode(rice.pastry.NodeHandle bootstrap, rice.pastry.NodeId nodeId)
          Call this to construct a new node of the type chosen by the factory, with the given nodeId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PastryNodeFactory

public PastryNodeFactory()
Method Detail

newNode

public abstract rice.pastry.PastryNode newNode(rice.pastry.NodeHandle bootstrap)
Call this to construct a new node of the type chosen by the factory.

Parameters:
bootstrap - The node handle to bootstrap off of

newNode

public abstract rice.pastry.PastryNode newNode(rice.pastry.NodeHandle bootstrap,
                                               rice.pastry.NodeId nodeId)
Call this to construct a new node of the type chosen by the factory, with the given nodeId.

Parameters:
bootstrap - The node handle to bootstrap off of
nodeId - The nodeId of the new node

getLeafSet

public abstract rice.pastry.leafset.LeafSet getLeafSet(rice.pastry.NodeHandle handle)
This method returns the remote leafset of the provided handle to the caller, in a protocol-dependent fashion. Note that this method may block while sending the message across the wire.

Parameters:
handle - The node to connect to
Returns:
The leafset of the remote node

getRouteRow

public abstract rice.pastry.routing.RouteSet[] getRouteRow(rice.pastry.NodeHandle handle,
                                                           int row)
This method returns the remote route row of the provided handle to the caller, in a protocol-dependent fashion. Note that this method may block while sending the message across the wire.

Parameters:
handle - The node to connect to
row - The row number to retrieve
Returns:
The route row of the remote node

getProximity

public abstract int getProximity(rice.pastry.NodeHandle local,
                                 rice.pastry.NodeHandle handle)
This method determines and returns the proximity of the current local node the provided NodeHandle. This will need to be done in a protocol- dependent fashion and may need to be done in a special way.

Parameters:
handle - The handle to determine the proximity of
Returns:
The proximity of the provided handle

getNearest

public rice.pastry.NodeHandle getNearest(rice.pastry.NodeHandle local,
                                         rice.pastry.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. The seed node provided is any node in the network which is a member of the pastry ring. This algorithm is designed to work in a protocol-independent manner, using the getResponse(Message) method provided by subclasses.

Parameters:
seed - Any member of the pastry ring
Returns:
A node suitable to boot off of (which is close the this node)

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection