Modifier and Type | Field and Description |
---|---|
static int |
FINGER_MAX |
static int |
FINGER_RESERVED |
IfcCallback |
onNeighbourChange |
static int |
PERIODICAL_DELAY |
Constructor and Description |
---|
Chord(java.lang.String myIp,
java.lang.Short myPort,
java.lang.String peerIp,
java.lang.Short peerPort,
IfcTransportServer ts,
IfcTransportClient tc)
After constructor you need to call startChord()
blocking till have received his successor
bootstrapping is to be done on higher level
supports loopback connections
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
debugInfo() |
java.lang.String |
debugInfoJSON() |
java.lang.Long |
getId()
LOCAL
|
java.lang.String |
getIdHexString()
LOCAL
|
java.lang.String |
getMyIp() |
java.lang.Long |
getPredecessor()
LOCAL
|
ID |
getPredecessorID()
LOCAL
|
ID |
getSuccessor()
LOCAL
|
boolean |
isRuning() |
void |
loopThroughPeers(IfcCallback each,
IfcCallback finish)
ASYNC
Loop through all peers
|
static boolean |
sphereIntervalBelongOpen(java.lang.Long id,
java.lang.Long from,
java.lang.Long to) |
static boolean |
sphereIntervalBelongRightClosed(java.lang.Long id,
java.lang.Long from,
java.lang.Long to) |
void |
startChordAsync(IfcCallback callback)
Starting is ASYNC
|
boolean |
startChordSync()
Starting is SYNC
|
void |
stopChord()
LOCAL
|
public static final int FINGER_MAX
public static final int FINGER_RESERVED
public static final int PERIODICAL_DELAY
public IfcCallback onNeighbourChange
public Chord(java.lang.String myIp, java.lang.Short myPort, java.lang.String peerIp, java.lang.Short peerPort, IfcTransportServer ts, IfcTransportClient tc)
myIp
- needed only to generate myIDmyPort
- peerIp
- peerPort
- ts
- tc
- public static boolean sphereIntervalBelongRightClosed(java.lang.Long id, java.lang.Long from, java.lang.Long to)
public static boolean sphereIntervalBelongOpen(java.lang.Long id, java.lang.Long from, java.lang.Long to)
public boolean startChordSync()
public void startChordAsync(IfcCallback callback)
public void stopChord()
public boolean isRuning()
public java.lang.String getMyIp()
public java.lang.String getIdHexString()
public java.lang.Long getPredecessor()
public ID getPredecessorID()
public ID getSuccessor()
public void loopThroughPeers(IfcCallback each, IfcCallback finish)
public java.lang.String debugInfo()
public java.lang.String debugInfoJSON()