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(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 Detail
-
StoreState
public StoreState(RouterContext ctx, Hash key, DatabaseEntry data)
-
StoreState
public StoreState(RouterContext ctx, Hash key, DatabaseEntry data, Set<Hash> toSkip)
-
-
Method Detail
-
getTarget
public Hash getTarget()
-
getData
public DatabaseEntry getData()
-
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)
-
addPending
public void addPending(Collection<Hash> pending)
-
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)
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; }
-
-