ePOST API

rice.pastry.standard
Class StandardLeafSetProtocol

java.lang.Object
  extended by rice.pastry.standard.StandardLeafSetProtocol
All Implemented Interfaces:
MessageReceiver

public class StandardLeafSetProtocol
extends java.lang.Object
implements MessageReceiver

An implementation of a simple leaf set protocol.

Version:
$Id: StandardLeafSetProtocol.java 3038 2006-02-07 10:01:01Z jeffh $
Author:
Peter Druschel, Andrew Ladd

Field Summary
protected  boolean failstop
           
protected  LeafSet leafSet
           
protected  NodeHandle localHandle
           
protected  PastryNode localNode
           
protected  Logger logger
           
protected  RoutingTable routeTable
           
protected  PastrySecurityManager security
           
 
Constructor Summary
StandardLeafSetProtocol(PastryNode ln, NodeHandle local, PastrySecurityManager sm, LeafSet ls, RoutingTable rt)
           
 
Method Summary
protected  void broadcast()
          Broadcast the leaf set to all members of the local leaf set.
protected  void broadcast(int type)
          Broadcast the leaf set to all members of the local leaf set.
protected  void broadcast(LeafSet ls, NodeHandle from)
          Broadcast the local leaf set to all members of the given leaf set, plus the node from which the leaf set was received.
protected  boolean checkLeafSet(LeafSet remotels, NodeHandle from, boolean notifyMissing)
          Checks a received leafset advertisement for missing nodes
 Address getAddress()
          Gets the address.
 void maintainLeafSet()
          Maintain the leaf set.
protected  boolean mergeLeafSet(LeafSet remotels, NodeHandle from)
          Merge a remote leafset into our own
 void receiveMessage(Message msg)
          Receives messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

failstop

protected final boolean failstop
See Also:
Constant Field Values

localHandle

protected NodeHandle localHandle

localNode

protected PastryNode localNode

security

protected PastrySecurityManager security

leafSet

protected LeafSet leafSet

routeTable

protected RoutingTable routeTable

logger

protected Logger logger
Constructor Detail

StandardLeafSetProtocol

public StandardLeafSetProtocol(PastryNode ln,
                               NodeHandle local,
                               PastrySecurityManager sm,
                               LeafSet ls,
                               RoutingTable rt)
Method Detail

getAddress

public Address getAddress()
Gets the address.

Returns:
the address.

receiveMessage

public void receiveMessage(Message msg)
Receives messages.

Specified by:
receiveMessage in interface MessageReceiver
Parameters:
msg - the message.

checkLeafSet

protected boolean checkLeafSet(LeafSet remotels,
                               NodeHandle from,
                               boolean notifyMissing)
Checks a received leafset advertisement for missing nodes

Parameters:
remotels - the remote leafset
from - the node from which we received the leafset
notifyMissing - if true, notify missing nodes
Returns:
true if any nodes where found missing in the received leafset

mergeLeafSet

protected boolean mergeLeafSet(LeafSet remotels,
                               NodeHandle from)
Merge a remote leafset into our own

Parameters:
remotels - the remote leafset
from - the node from which we received the leafset
Returns:
true if the leafset changed

broadcast

protected void broadcast()
Broadcast the leaf set to all members of the local leaf set.


broadcast

protected void broadcast(int type)
Broadcast the leaf set to all members of the local leaf set.

Parameters:
type - the type of broadcast message used

broadcast

protected void broadcast(LeafSet ls,
                         NodeHandle from)
Broadcast the local leaf set to all members of the given leaf set, plus the node from which the leaf set was received.

Parameters:
ls - the leafset whose members we send to local leaf set
from - the node from which ls was received

maintainLeafSet

public void maintainLeafSet()
Maintain the leaf set. This method checks for dead leafset entries and replaces them as needed. It is assumed that this method be invoked periodically.


ePOST API

Copyright © 2001-2005 - Rice Pastry.