java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.SearchJob.FailedJob
- All Implemented Interfaces:
Job
- Enclosing class:
SearchJob
Called when a particular peer failed to respond before the timeout was reached, or if the peer could not be contacted at all.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanFloodfill flag.private HashPeer hash.private booleanPenalize peer flag.private longSent time.Constructor Summary
ConstructorsConstructorDescriptionFailedJob(RouterContext enclosingContext, RouterInfo peer) Mark the peer as failed for this search.FailedJob(RouterContext enclosingContext, RouterInfo peer, boolean penalizePeer) Allow the choice as to whether failed searches should count against the peer (such as if we search for a random key).Method Summary
All MethodsMethods inherited from class JobImpl
dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringModifier and TypeMethodDescriptionvoiddropped()Default implementation does nothing.final RouterContextThe router context that this job belongs to.longgetJobId()The unique job ID for this job.longThe timestamp when this job was last made ready for execution.The timing object for this job.voidmadeReady(long now) For JobQueue only, not for external use.protected voidrequeue(long delayMs) Requeue this job to run after the specified delay.toString()
Field Details
_peer
Peer hash._isFloodfill
private boolean _isFloodfillFloodfill flag._penalizePeer
private boolean _penalizePeerPenalize peer flag._sentOn
private long _sentOnSent time.
Constructor Details
FailedJob
Mark the peer as failed for this search.- Parameters:
enclosingContext- the router contextpeer- peer that was sent the search and is penalized on timeout
FailedJob
Allow the choice as to whether failed searches should count against the peer (such as if we search for a random key).- Parameters:
enclosingContext- router context for the job queue and clockpeer- peer the search was sent to, which is marked failed when the timeout runs outpenalizePeer- true to record the timeout against the peer profile, false for searches of a random key
Method Details
runJob
public void runJob()Notify the search of a peer timeout and optionally penalize.getName