Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.ubermq.chord
Interface ChordNode  view ChordNode download ChordNode.java

All Known Subinterfaces:
ChordNodeProvider
All Known Implementing Classes:
AbstractChordNode

public interface ChordNode

Defines a node in the Chord system. Every node has an identifier in the identifier space, a successor node, and a finger table for efficient routing.


Method Summary
 void close()
          Closes the node's resources.
 ChordNode closestPrecedingFinger(ChordIdentifier id)
          Returns the element of the finger table that most closely precedes the given identifier.
 ChordNode[] fingers()
          Returns the finger table for this node.
 ChordIdentifier identifier()
          Returns the identifier for this node.
 void join(ChordInfrastructure i)
          Joins the node to the specified infrastructure.
 void leave(ChordInfrastructure i)
          Leaves the infrastructure, by notifying the immediate predecessor that we are going away.
 void notify(ChordNode n)
          Instructs the node that the specified node may be its predecessor.
 void notifyGoingAway(ChordNode n)
          Instructs the node that the specified node is leaving the infrastructure.
 ChordNode predecessor()
          Returns the predecessor of this node, defined as the node n such that n.successor() == this.
 java.lang.Object query(java.lang.Object key)
          Queries the node for the object indexed at the specified key.
 void store(java.lang.Object key, java.lang.Object value)
          Stores the specified object at the given key, on this node.
 ChordNode successor()
          Returns the successor of this node.
 java.lang.String toHtml()
          Returns an in-depth HTML description of this chord node.
 

Method Detail

identifier

public ChordIdentifier identifier()
Returns the identifier for this node.


close

public void close()
Closes the node's resources.


join

public void join(ChordInfrastructure i)
Joins the node to the specified infrastructure. This causes the node to perform any logic that is required to inform itself or other nodes in the infrastructure about its presence.


leave

public void leave(ChordInfrastructure i)
Leaves the infrastructure, by notifying the immediate predecessor that we are going away.


notify

public void notify(ChordNode n)
Instructs the node that the specified node may be its predecessor.


notifyGoingAway

public void notifyGoingAway(ChordNode n)
Instructs the node that the specified node is leaving the infrastructure. This may be received by an existing predecessor or successor node.


fingers

public ChordNode[] fingers()
Returns the finger table for this node. The finger table is a set of nodes, such that the ith entry contains the identity of the first node that succeeds this node by at least 2 i-1 on the identifier circle.


closestPrecedingFinger

public ChordNode closestPrecedingFinger(ChordIdentifier id)
Returns the element of the finger table that most closely precedes the given identifier.


predecessor

public ChordNode predecessor()
Returns the predecessor of this node, defined as the node n such that n.successor() == this.


successor

public ChordNode successor()
Returns the successor of this node.


query

public java.lang.Object query(java.lang.Object key)
Queries the node for the object indexed at the specified key. If the key is not found, the method returns null.


store

public void store(java.lang.Object key,
                  java.lang.Object value)
Stores the specified object at the given key, on this node. The node may refuse the key if the hash value is not consistent.


toHtml

public java.lang.String toHtml()
Returns an in-depth HTML description of this chord node. The information returned could include the set of keys stored here, etc.

It is anticipated that this method may be costly to invoke. Please do not use it for debugging purposes.