|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.tomp2p.futures.BaseFutureImpl<FutureRouting>
net.tomp2p.futures.FutureRouting
public class FutureRouting
The routing future keeps track of the routing process. This means that the routing future is returned immediately and the routing process starts in the background. There are two ways to wait for the routing process: (1) to use await*, which blocks the current thread and waits for the routing process to complete, or (2) to use addListener*, which will be called when the routing process completes. The listener may or may not run in the same thread. The routing will always succeed if we do DHT operations or bootstrap to ourself. It will fail if we bootstrap to another peer, but could not contact any peer than ourself.
#setNeighbors(SortedSet, SortedSet, SortedSet, boolean, boolean)
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.tomp2p.futures.BaseFuture |
---|
BaseFuture.FutureType |
Field Summary |
---|
Fields inherited from class net.tomp2p.futures.BaseFutureImpl |
---|
completed, lock, reason, type |
Constructor Summary | |
---|---|
FutureRouting()
|
Method Summary | |
---|---|
NavigableSet<PeerAddress> |
getDirectHits()
The direct hits set contains those peers that reported to have the key (Number160) we were looking for. |
SortedMap<PeerAddress,DigestInfo> |
getDirectHitsDigest()
The direct hits map contains those peers that reported to have the key (Number160) we were looking for including its digest (size of the result set and its xored hashes). |
String |
getFailedReason()
The default failed reason is Unknown. |
NavigableSet<PeerAddress> |
getPotentialHits()
The potential hits set contains those peers that are in the direct hit and that did report to *not* have the key (Number160) we were looking for. |
SortedSet<PeerAddress> |
getRoutingPath()
Returns the peers that have been asked to provide neighbor information. |
void |
setNeighbors(SortedMap<PeerAddress,DigestInfo> directHits,
NavigableSet<PeerAddress> potentialHits,
SortedSet<PeerAddress> routingPath,
boolean isBootstrap,
boolean isRoutingToOther)
Sets the result of the routing process and finishes the future. |
Methods inherited from class net.tomp2p.futures.BaseFutureImpl |
---|
addCancellation, addListener, addListener, await, await, awaitListeners, awaitUninterruptibly, awaitUninterruptibly, cancel, getType, isCompleted, isFailed, isSuccess, notifyListerenrs, removeListener, self, setCompletedAndNotify, setFailed, setFailed, setFailed, setFailed, setFailed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FutureRouting()
Method Detail |
---|
public void setNeighbors(SortedMap<PeerAddress,DigestInfo> directHits, NavigableSet<PeerAddress> potentialHits, SortedSet<PeerAddress> routingPath, boolean isBootstrap, boolean isRoutingToOther)
directHits
- The direct hits, the peers in the direct set that reports to have the key (Number160) we were
looking for.potentialHits
- The potential hits, the peers in the direct set and those peers that reports to *not* have
the key (Number160) we were looking for.routingPath
- A set of peers that took part in the routing process.isBootstrap
- Whether the future was triggered by the bootstrap process or the a P2P processisRoutingToOther
- Whether routing peers have been specified others than myself.getDirectHits()
,
getDirectHitsDigest()
,
getPotentialHits()
,
getRoutingPath()
public NavigableSet<PeerAddress> getPotentialHits()
getDirectHits()
,
getDirectHitsDigest()
public NavigableSet<PeerAddress> getDirectHits()
getPotentialHits()
,
getDirectHitsDigest()
public SortedMap<PeerAddress,DigestInfo> getDirectHitsDigest()
getPotentialHits()
,
getDirectHits()
public SortedSet<PeerAddress> getRoutingPath()
public String getFailedReason()
BaseFuture
getFailedReason
in interface BaseFuture
getFailedReason
in class BaseFutureImpl<FutureRouting>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |