Class StoreState
java.lang.Object
net.i2p.router.networkdb.kademlia.StoreState
Tracks the state of a StoreJob
-
Constructor Summary
ConstructorDescriptionStoreState
(RouterContext ctx, Hash key, DatabaseEntry data) StoreState
(RouterContext ctx, Hash key, DatabaseEntry data, Set<Hash> toSkip) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPending
(Hash peer) Increments attempted countvoid
addPending
(Hash peer, MessageWrapper.WrappedMessage msg) void
addSkipped
(Hash peer) we aren't even going to try to contact this peervoid
complete
(boolean completed) boolean
long
The peers attempted OR skipped.int
The number of peers attempted.int
getData()
int
The number of peers pending.getPendingMessage
(Hash peer) Return a successful peer (a random one if more than one was successful) or null.long
long
void
replyTimeout
(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
-