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
Modifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLocalChordNode
(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:RemoteChordNode
NOOP/ping method used to check if callee is still alive.- Specified by:
checkAlive
in interfaceRemoteChordNode
-
getPredecessor
Description copied from interface:RemoteChordNode
Returns the predecessor.- Specified by:
getPredecessor
in interfaceRemoteChordNode
-
getSuccessor
Description copied from interface:RemoteChordNode
Returns the successor.- Specified by:
getSuccessor
in interfaceRemoteChordNode
-
offerAsPredecessor
Description copied from interface:RemoteChordNode
Offers callee to set caller as new predecessor.- Specified by:
offerAsPredecessor
in interfaceRemoteChordNode
-
findSuccessor
Description copied from interface:RemoteChordNode
Find successor forid
.n.find_successor(id)
- Specified by:
findSuccessor
in interfaceRemoteChordNode
-
isStable
Description copied from interface:RemoteChordNode
Check if node is stable (has successor and predecessor or neither).- Specified by:
isStable
in interfaceRemoteChordNode
-
findClosestFingerPreceding
Description copied from interface:RemoteChordNode
Find the closest finger preceding.n.closest_preceding_finger(id)
- Specified by:
findClosestFingerPreceding
in 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
-