Class StoreState
- java.lang.Object
-
- net.i2p.router.networkdb.kademlia.StoreState
-
class StoreState extends Object
Tracks the state of a StoreJob
-
-
Constructor Summary
Constructors Constructor Description StoreState(RouterContext ctx, Hash key, DatabaseEntry data)
StoreState(RouterContext ctx, Hash key, DatabaseEntry data, Set<Hash> toSkip)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
completed()
long
confirmed(Hash peer)
Set<Hash>
getAttempted()
The peers attempted OR skipped.int
getAttemptedCount()
The number of peers attempted.int
getCompleteCount()
DatabaseEntry
getData()
int
getPendingCount()
The number of peers pending.MessageWrapper.WrappedMessage
getPendingMessage(Hash peer)
Hash
getSuccessful()
Return a successful peer (a random one if more than one was successful) or null.Hash
getTarget()
long
getWhenCompleted()
long
getWhenStarted()
void
replyTimeout(Hash peer)
String
toString()
-
-
-
Constructor Detail
-
StoreState
public StoreState(RouterContext ctx, Hash key, DatabaseEntry data)
-
StoreState
public StoreState(RouterContext ctx, Hash key, DatabaseEntry data, Set<Hash> toSkip)
- 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 Detail
-
getTarget
public Hash getTarget()
-
getData
public DatabaseEntry getData()
-
getPendingCount
public int getPendingCount()
The number of peers pending.- Since:
- 0.9.53 replaces getPending()
-
getAttempted
public Set<Hash> 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
public Hash 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
public void addPending(Hash peer, MessageWrapper.WrappedMessage msg)
-
getPendingMessage
public MessageWrapper.WrappedMessage getPendingMessage(Hash peer)
-
addPending
public void addPending(Hash peer)
Increments attempted count
-
addSkipped
public void addSkipped(Hash peer)
we aren't even going to try to contact this peer
-
confirmed
public long confirmed(Hash peer)
-
replyTimeout
public void replyTimeout(Hash peer)
-
-