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
Modifier and Type Method Description void
addPending(Collection<Hash> pending)
void
addPending(Hash peer)
void
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()
int
getCompleteCount()
DatabaseEntry
getData()
Set<Hash>
getFailed()
getFailedSet<Hash>
getPending()
MessageWrapper.WrappedMessage
getPendingMessage(Hash peer)
Set<Hash>
getSuccessful()
Hash
getTarget()
long
getWhenCompleted()
long
getWhenStarted()
void
replyTimeout(Hash peer)
public long confirmedExploratory(Hash peer) { long rv = -1; synchronized (_pendingPeers) { _pendingPeers.remove(peer); Long when = _pendingPeerTimes.remove(peer); if (when != null) rv = _context.clock().now() - when.longValue(); } synchronized (_successfulExploratoryPeers) { _successfulExploratoryPeers.add(peer); } return rv; }String
toString()
-
Constructor Details
-
Method Details
-
getTarget
-
getData
-
getPending
-
getAttempted
-
getSuccessful
-
getFailed
getFailed -
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
-
addPending
-
addSkipped
we aren't even going to try to contact this peer -
confirmed
-
replyTimeout
public long confirmedExploratory(Hash peer) { long rv = -1; synchronized (_pendingPeers) { _pendingPeers.remove(peer); Long when = _pendingPeerTimes.remove(peer); if (when != null) rv = _context.clock().now() - when.longValue(); } synchronized (_successfulExploratoryPeers) { _successfulExploratoryPeers.add(peer); } return rv; } -
toString
-