Package org.drasyl.handler.dht.chord
Class LocalChordNode
java.lang.Object
org.drasyl.handler.dht.chord.LocalChordNode
- All Implemented Interfaces:
RemoteChordNode
Our local Chord node.
This class is based on Chord implementation of Chuan Xia.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLocalChordNode(DrasylAddress localAddress, ChordFingerTable fingerTable, RmiClientHandler client) LocalChordNode(DrasylAddress address, RmiClientHandler client) -
Method Summary
Modifier and TypeMethodDescriptionio.netty.util.concurrent.Future<Void>NOOP/ping method used to check if callee is still alive.io.netty.util.concurrent.Future<Void>Returns a successfully completed future if our predecessor is alive or we do not have a predecessor.io.netty.util.concurrent.Future<DrasylAddress>findClosestFingerPreceding(long id) Find the closest finger preceding.io.netty.util.concurrent.Future<DrasylAddress>findSuccessor(long id) Find successor forid.io.netty.util.concurrent.Future<Void>fixFinger(int i) io.netty.util.concurrent.Future<DrasylAddress>Returns the predecessor.io.netty.util.concurrent.Future<DrasylAddress>Returns the successor.io.netty.util.concurrent.Future<Boolean>isStable()Check if node is stable (has successor and predecessor or neither).io.netty.util.concurrent.Future<Void>join(DrasylAddress contact) Join circle by contactingcontact.io.netty.util.concurrent.Future<Void>Offers callee to set caller as new predecessor.io.netty.util.concurrent.Future<Void>verify my immediate successor, and tell the successor about me.toString()
-
Field Details
-
BIND_NAME
-
-
Constructor Details
-
LocalChordNode
public LocalChordNode(DrasylAddress localAddress, ChordFingerTable fingerTable, RmiClientHandler client) -
LocalChordNode
-
-
Method Details
-
toString
-
checkAlive
Description copied from interface:RemoteChordNodeNOOP/ping method used to check if callee is still alive.- Specified by:
checkAlivein interfaceRemoteChordNode
-
getPredecessor
Description copied from interface:RemoteChordNodeReturns the predecessor.- Specified by:
getPredecessorin interfaceRemoteChordNode
-
getSuccessor
Description copied from interface:RemoteChordNodeReturns the successor.- Specified by:
getSuccessorin interfaceRemoteChordNode
-
offerAsPredecessor
Description copied from interface:RemoteChordNodeOffers callee to set caller as new predecessor.- Specified by:
offerAsPredecessorin interfaceRemoteChordNode
-
findSuccessor
Description copied from interface:RemoteChordNodeFind successor forid.n.find_successor(id)- Specified by:
findSuccessorin interfaceRemoteChordNode
-
isStable
Description copied from interface:RemoteChordNodeCheck if node is stable (has successor and predecessor or neither).- Specified by:
isStablein interfaceRemoteChordNode
-
findClosestFingerPreceding
Description copied from interface:RemoteChordNodeFind the closest finger preceding.n.closest_preceding_finger(id)- Specified by:
findClosestFingerPrecedingin interfaceRemoteChordNode
-
join
Join circle by contactingcontact. -
checkIfPredecessorIsAlive
Returns a successfully completed future if our predecessor is alive or we do not have a predecessor. Otherwise, the future will fail. -
stabilize
verify my immediate successor, and tell the successor about me. -
fixFinger
-