${header}

meteor.dht.chord
Class FingerTable

java.lang.Object
  extended bymeteor.dht.chord.FingerTable

public class FingerTable
extends java.lang.Object

The Finger Table exists for every node in the ring. It stores information that help making the routing faster. Stores identifiers at levels 1 to 2^dimension of the ring Stores successors of each identifier at every level


Constructor Summary
FingerTable(java.math.BigInteger id, int dimension)
          Specifies the identifier at which this finger table refers to
 
Method Summary
 void add(java.math.BigInteger chord, java.lang.String jxta)
          Adding an entry to the map ChordID to JXTA ID
 java.util.HashMap getHashmap()
          Return the entire HashMap
 java.math.BigInteger getIdentifier()
          Returns this node's identifier
 java.math.BigInteger getIdentifier(int level)
          Returns the identifier at level @level
 java.math.BigInteger[] getIdentifiers()
          Returns the array of identifiers at each level [2^0+n] to [2^i+n] where i
 int getLevelOfIdentifier(java.math.BigInteger id)
           
 java.lang.String getMap(java.math.BigInteger id)
          Getting from the list of existing addresses
 java.math.BigInteger getPredecessor()
           
 java.math.BigInteger getSuccessor()
          Returns successor
 java.math.BigInteger getSuccessorAt(int level)
           
 boolean isSuccOfIdSet(int level)
           
 java.lang.String printMap()
          Print the Mapping table
 void remove(java.math.BigInteger chord)
          Remove an entry from the map table
 void setAllSuccessorsTo(java.math.BigInteger id)
           
 void setHashmap(java.util.HashMap m)
          Set the Hash Map
 void setIdentifiers()
          Given this nodes identifier, creates all successive identifiers at each level
 void setPredecessor(java.math.BigInteger prevNode)
          Setting the predecessor node at a specific level
 void setSuccessor(java.math.BigInteger nextNode)
          Setting the successor node
 void setSuccessorOf(java.math.BigInteger id, int level)
          Sets the successor at a certain level
 java.lang.String showTable()
          prints the tables identifiers successors
 void updateFingersTo(java.math.BigInteger old, java.math.BigInteger newID)
          Resets all successors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FingerTable

public FingerTable(java.math.BigInteger id,
                   int dimension)
Specifies the identifier at which this finger table refers to

Method Detail

getMap

public java.lang.String getMap(java.math.BigInteger id)
Getting from the list of existing addresses

Parameters:
id - the Chord ID of which we want to obtain the Corresponding JXTA id
Returns:
the JXTA id string that will be used to send a message

getHashmap

public java.util.HashMap getHashmap()
Return the entire HashMap


setHashmap

public void setHashmap(java.util.HashMap m)
Set the Hash Map


printMap

public java.lang.String printMap()
Print the Mapping table


add

public void add(java.math.BigInteger chord,
                java.lang.String jxta)
Adding an entry to the map ChordID to JXTA ID


remove

public void remove(java.math.BigInteger chord)
Remove an entry from the map table


getIdentifiers

public java.math.BigInteger[] getIdentifiers()
Returns the array of identifiers at each level [2^0+n] to [2^i+n] where i

getIdentifier

public java.math.BigInteger getIdentifier(int level)
Returns the identifier at level @level


getIdentifier

public java.math.BigInteger getIdentifier()
Returns this node's identifier


setIdentifiers

public void setIdentifiers()
Given this nodes identifier, creates all successive identifiers at each level


setSuccessor

public void setSuccessor(java.math.BigInteger nextNode)
Setting the successor node


setSuccessorOf

public void setSuccessorOf(java.math.BigInteger id,
                           int level)
Sets the successor at a certain level

Parameters:
id - the identifier of the successor at spcecified level
level - the level for which the successor has to be set

updateFingersTo

public void updateFingersTo(java.math.BigInteger old,
                            java.math.BigInteger newID)
Resets all successors


setAllSuccessorsTo

public void setAllSuccessorsTo(java.math.BigInteger id)

getLevelOfIdentifier

public int getLevelOfIdentifier(java.math.BigInteger id)

getSuccessorAt

public java.math.BigInteger getSuccessorAt(int level)

isSuccOfIdSet

public boolean isSuccOfIdSet(int level)

getPredecessor

public java.math.BigInteger getPredecessor()

getSuccessor

public java.math.BigInteger getSuccessor()
Returns successor


setPredecessor

public void setPredecessor(java.math.BigInteger prevNode)
Setting the predecessor node at a specific level


showTable

public java.lang.String showTable()
prints the tables identifiers successors


${header}