Rice Pastry API

rice.pastry.socket
Class SocketPastryNodeFactory.TLBootstrapper

java.lang.Object
  extended by rice.pastry.socket.SocketPastryNodeFactory.TLBootstrapper
All Implemented Interfaces:
Bootstrapper<java.net.InetSocketAddress>
Enclosing class:
SocketPastryNodeFactory

public class SocketPastryNodeFactory.TLBootstrapper
extends java.lang.Object
implements Bootstrapper<java.net.InetSocketAddress>


Field Summary
protected  SocketNodeHandleFactory handleFactory
           
protected  Logger logger
           
protected  PastryNode pn
           
protected  ProximityNeighborSelector pns
           
protected  TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,RawMessage> tl
           
 
Constructor Summary
SocketPastryNodeFactory.TLBootstrapper(PastryNode pn, TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,RawMessage> tl, SocketNodeHandleFactory handleFactory, ProximityNeighborSelector pns)
           
 
Method Summary
 void boot(java.util.Collection<java.net.InetSocketAddress> bootaddresses_temp)
          This method is a bit out of order to make it work on any thread.
protected  void bootAsBootstrap()
           
protected  void checkLiveness(SocketNodeHandle h, java.util.Map<java.lang.String,java.lang.Object> options)
           
protected  SocketNodeHandle getTempNodeHandle(java.net.InetSocketAddress addr)
          Used as a helper to TLBootstrapper.boot() to generate a temporary node handle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pn

protected PastryNode pn

tl

protected TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,RawMessage> tl

handleFactory

protected SocketNodeHandleFactory handleFactory

pns

protected ProximityNeighborSelector pns

logger

protected Logger logger
Constructor Detail

SocketPastryNodeFactory.TLBootstrapper

public SocketPastryNodeFactory.TLBootstrapper(PastryNode pn,
                                              TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,RawMessage> tl,
                                              SocketNodeHandleFactory handleFactory,
                                              ProximityNeighborSelector pns)
Method Detail

bootAsBootstrap

protected void bootAsBootstrap()

boot

public void boot(java.util.Collection<java.net.InetSocketAddress> bootaddresses_temp)
This method is a bit out of order to make it work on any thread. The method itself is non-blocking. The problem is that we don't have any NodeHandles yet, only Ip addresses. So, we're going to check liveness on a bogus node handle, and when the WrongEpochAddress message comes back, the bogus node will be faulty, but a new node (the real NodeHandle at that address) will come alive. We can discover this by installing a LivenessListener on the transport layer. Here is what happens: Create the "bogus" NodeHandles and store them in tempBootHandles Register LivenessListener on transport layer. Ping all of the "bogus" NodeHandles When liveness changes to Non-Faulty it means we have found a new node. When we collect all of the bootaddresses, or there is a timeout, we call continuation.receiveResult() Continuation.receiveResult() unregisters the LivenessListener and then calls ProximityNeighborSelection.nearNodes() PNS.nearNodes() calls into the continuation which calls PastryNode.doneNode()

Specified by:
boot in interface Bootstrapper<java.net.InetSocketAddress>

getTempNodeHandle

protected SocketNodeHandle getTempNodeHandle(java.net.InetSocketAddress addr)
Used as a helper to TLBootstrapper.boot() to generate a temporary node handle

Parameters:
addr -
Returns:

checkLiveness

protected void checkLiveness(SocketNodeHandle h,
                             java.util.Map<java.lang.String,java.lang.Object> options)

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection