Class StoreState
java.lang.Object
net.i2p.router.networkdb.kademlia.StoreState
Tracks the state of a StoreJob
-
Constructor Summary
ConstructorsConstructorDescriptionStoreState(RouterContext ctx, Hash key, DatabaseEntry data) StoreState(RouterContext ctx, Hash key, DatabaseEntry data, Set<Hash> toSkip) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPending(Hash peer) Increments attempted countvoidaddPending(Hash peer, MessageWrapper.WrappedMessage msg) voidaddSkipped(Hash peer) we aren't even going to try to contact this peervoidcomplete(boolean completed) booleanlongThe peers attempted OR skipped.intThe number of peers attempted.intgetData()intThe number of peers pending.getPendingMessage(Hash peer) Return a successful peer (a random one if more than one was successful) or null.longlongvoidreplyTimeout(Hash peer) toString()
-
Constructor Details
-
StoreState
-
StoreState
- Parameters:
key- the DatabaseEntry hashtoSkip- may be null, if non-null, all attempted and skipped targets will be added as of 0.9.53
-
-
Method Details
-
getTarget
-
getData
-
getPendingCount
public int getPendingCount()The number of peers pending.- Since:
- 0.9.53 replaces getPending()
-
getAttempted
The peers attempted OR skipped. DOES include skipped peers. Use getAttemptedCount for the number of attempts. -
getAttemptedCount
public int getAttemptedCount()The number of peers attempted. Does not include skipped peers. Do not use getAttempted().size() as that does include skipped peers.- Since:
- 0.9.53
-
getSuccessful
Return a successful peer (a random one if more than one was successful) or null.- Since:
- 0.9.53 formerly returned a copy of the Set
-
completed
public boolean completed() -
complete
public void complete(boolean completed) -
getCompleteCount
public int getCompleteCount() -
getWhenStarted
public long getWhenStarted() -
getWhenCompleted
public long getWhenCompleted() -
addPending
-
getPendingMessage
-
addPending
Increments attempted count -
addSkipped
we aren't even going to try to contact this peer -
confirmed
-
replyTimeout
-
toString
-