|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcs138.chord.ChordNodeImpl
public class ChordNodeImpl
This class is our main implementation of a ChordNode
| Constructor Summary | |
|---|---|
ChordNodeImpl()
Creates a new Chord node with the given identifier. |
|
| Method Summary | |
|---|---|
RemoteChordNode |
findSuccessor(java.math.BigInteger hash)
Find the Chord node responsible for the given key. |
java.io.Serializable |
get(java.lang.String key)
The publicly available "get" method. |
ChordNode[] |
getFingerTable()
|
java.lang.String |
getIdentifier()
|
java.util.List<java.lang.String> |
getKeys()
|
java.io.Serializable |
getLocal(java.lang.String key)
Get the data associated with the specified key. |
java.lang.Class<? extends NodeMonitor> |
getMonitorInterface()
This returns the Node implementation specific monitor that will be used. |
java.math.BigInteger |
getNodeHash()
|
int |
getNumKeys()
|
ChordNode |
getPredecessor()
|
ChordNode |
getSuccessor()
|
void |
initialize(java.lang.String id,
ManageableNode node,
NodeMonitor monitor)
Initializes a new node |
boolean |
isReady()
Determines that the node in question has been set up and is ready to be used. |
void |
leave()
Called when the node wants to leave the Chord ring. |
ChordNode |
locate(java.lang.String key)
Find the Chord node responsible for the given key. |
void |
notify(RemoteChordNode node)
The caller of this method believes that "node" should be this node's predecessor. |
void |
ping()
This method is used in nodes to determine that they are still up. |
boolean |
put(java.lang.String key,
java.io.Serializable data)
The publicly available "put" method. |
boolean |
putLocal(java.lang.String key,
java.io.Serializable data)
Insert a key-value pair into the hash table. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChordNodeImpl()
throws java.rmi.RemoteException
java.rmi.RemoteException| Method Detail |
|---|
public void initialize(java.lang.String id,
ManageableNode node,
NodeMonitor monitor)
throws java.rmi.RemoteException
ManageableNode
initialize in interface ManageableNodeid - The identifier of the nodenode - A gateway node, may be nullmonitor - The default monitor to attach
java.rmi.RemoteException
public RemoteChordNode findSuccessor(java.math.BigInteger hash)
throws java.rmi.RemoteException
findSuccessor in interface RemoteChordNodehash - The hash of the key you are looking for
java.rmi.RemoteException
public void notify(RemoteChordNode node)
throws java.rmi.RemoteException
notify in interface RemoteChordNodenode - The node that believes it is the new predecessor
java.rmi.RemoteException
public void leave()
throws java.rmi.RemoteException
leave in interface ChordNodejava.rmi.RemoteException
public java.io.Serializable get(java.lang.String key)
throws java.rmi.RemoteException
get in interface ChordNodejava.rmi.RemoteException
public java.io.Serializable getLocal(java.lang.String key)
throws java.rmi.RemoteException
getLocal in interface RemoteChordNodekey - The key to look up.
java.rmi.RemoteException
public boolean put(java.lang.String key,
java.io.Serializable data)
throws java.rmi.RemoteException
put in interface ChordNodejava.rmi.RemoteException
public boolean putLocal(java.lang.String key,
java.io.Serializable data)
throws java.rmi.RemoteException
putLocal in interface RemoteChordNodekey - The key.data - The value associated with the key.
java.rmi.RemoteException
public ChordNode locate(java.lang.String key)
throws java.rmi.RemoteException
locate in interface ChordNodekey - The key to locate.
java.rmi.RemoteException
public ChordNode[] getFingerTable()
throws java.rmi.RemoteException
getFingerTable in interface ChordNodejava.rmi.RemoteException
public java.lang.String getIdentifier()
throws java.rmi.RemoteException
getIdentifier in interface ChordNodejava.rmi.RemoteException
public java.util.List<java.lang.String> getKeys()
throws java.rmi.RemoteException
getKeys in interface ChordNodejava.rmi.RemoteException
public java.math.BigInteger getNodeHash()
throws java.rmi.RemoteException
getNodeHash in interface ChordNodejava.rmi.RemoteException
public int getNumKeys()
throws java.rmi.RemoteException
getNumKeys in interface ChordNodejava.rmi.RemoteException
public ChordNode getPredecessor()
throws java.rmi.RemoteException
getPredecessor in interface ChordNodejava.rmi.RemoteException
public ChordNode getSuccessor()
throws java.rmi.RemoteException
getSuccessor in interface ChordNodejava.rmi.RemoteException
public boolean isReady()
throws java.rmi.RemoteException
ChordNode
isReady in interface ChordNodejava.rmi.RemoteException
public void ping()
throws java.rmi.RemoteException
ManageableNode
ping in interface ManageableNodejava.rmi.RemoteException
public java.lang.Class<? extends NodeMonitor> getMonitorInterface()
throws java.rmi.RemoteException
ManageableNode
getMonitorInterface in interface ManageableNodejava.rmi.RemoteException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||