Rice Pastry API

rice.pastry
Class PastryNodeFactory

java.lang.Object
  extended byrice.pastry.PastryNodeFactory
Direct Known Subclasses:
DirectPastryNodeFactory, DistPastryNodeFactory

public abstract class PastryNodeFactory
extends java.lang.Object

The interface to an object which can construct PastryNodes.

Version:
$Id: PastryNodeFactory.java,v 1.14 2005/05/25 16:50:08 jeffh Exp $
Author:
Andrew Ladd, Alan Mislove, Merziyah Poonawala, Abhishek Ray

Constructor Summary
PastryNodeFactory()
           
 
Method Summary
abstract  LeafSet getLeafSet(NodeHandle handle)
          This method returns the remote leafset of the provided handle to the caller, in a protocol-dependent fashion.
 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  PastryNode newNode(NodeHandle bootstrap)
          Call this to construct a new node of the type chosen by the factory.
abstract  PastryNode newNode(NodeHandle bootstrap, 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

getLeafSet

public abstract LeafSet getLeafSet(NodeHandle handle)
                            throws java.io.IOException
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
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION

getRouteRow

public abstract RouteSet[] getRouteRow(NodeHandle handle,
                                       int row)
                                throws java.io.IOException
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
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION

getProximity

public abstract int getProximity(NodeHandle local,
                                 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
local - DESCRIBE THE PARAMETER
Returns:
The proximity of the provided handle

getNearest

public 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. 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
local - DESCRIBE THE PARAMETER
Returns:
A node suitable to boot off of (which is close the this node)

newNode

public abstract PastryNode newNode(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
Returns:
DESCRIBE THE RETURN VALUE

newNode

public abstract PastryNode newNode(NodeHandle bootstrap,
                                   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
Returns:
DESCRIBE THE RETURN VALUE

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection