java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.FloodSearchJob
net.i2p.router.networkdb.kademlia.FloodOnlySearchJob
net.i2p.router.networkdb.kademlia.SingleSearchJob
net.i2p.router.networkdb.kademlia.IterativeFollowupJob
- All Implemented Interfaces:
Job
Performs targeted followup lookups during iterative search operations.
Extends SingleSearchJob to query specific peers for RouterInfo during iterative searches. Unlike SingleSearchJob, this class notifies the parent search job when successful, allowing the iterative search to incorporate the new peer into its search strategy.
Used when iterative searches discover new peers that need direct querying to obtain their RouterInfo for further search refinement. Provides seamless integration with the iterative search algorithm while reusing existing selector infrastructure.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IterativeSearchJobThe iterative search this job follows up on.Fields inherited from class FloodOnlySearchJob
_onReply, _onTimeout, _replySelectorModifier and TypeFieldDescriptionprotected final ReplyJobJob to run on reply.protected final JobJob to run on timeout.protected final MessageSelectorReply message selector.Fields inherited from class FloodSearchJob
_created, _dead, _expiration, _facade, _isLease, _key, _log, _lookupsRemaining, _onFailed, _onFind, _success, _timeoutMs, CONCURRENT_SEARCHESModifier and TypeFieldDescriptionprotected final longSystem time when this search was created.protected booleanWhether this search has been marked as completed.protected longDeadline after which the search expires.protected final FloodfillNetworkDatabaseFacadeFloodfill network database facade.protected final booleanWhether the target is a LeaseSet lookup.protected final HashTarget database entry hash being searched.protected final LogClass logger.protected final AtomicIntegerRemaining flood lookups before fallback to iterative search.Callbacks for search failure.Callbacks for successful search completion.protected booleanWhether the search completed successfully.protected intTimeout for the search in milliseconds.protected static final intMax simultaneous flood lookups before fallback.Constructor Summary
ConstructorsConstructorDescriptionIterativeFollowupJob(RouterContext ctx, Hash key, Hash to, IterativeSearchJob search) Queries one peer for a single key on behalf of an iterative search.Method Summary
Public MethodsMethods inherited from class SingleSearchJob
failed, runJob, shouldProcessDSRMMethods inherited from class FloodOnlySearchJob
decrementRemainingModifier and TypeMethodDescription(package private) intdecrementRemaining(Hash peer) Note that we heard from the peer.Methods inherited from class FloodSearchJob
addDeferred, decrementRemaining, getCreated, getExpiration, getKey, getLookupsRemainingModifier and TypeMethodDescription(package private) voidaddDeferred(Job onFind, Job onFailed, long timeoutMs, boolean isLease) Add jobs to an existing search.protected intNumber of lookups remaining after decrementing.longSystem time, NOT context time.longExpiration time from the context clock.getKey()The database entry hash being searched.protected intNumber of flood lookups still pending.Methods 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
_search
The iterative search this job follows up on.
Constructor Details
IterativeFollowupJob
Queries one peer for a single key on behalf of an iterative search.- Parameters:
ctx- the router context the lookup runs againstkey- the hash being looked up, passed to the SingleSearchJob superclassto- the peer to query directly for that key, passed to the SingleSearchJob superclasssearch- the parent iterative search, notified of a successful lookup so it can adopt the new peer
Method Details
getName
Name of this job.- Specified by:
getNamein interfaceJob- Overrides:
getNamein classSingleSearchJob- Returns:
- the name this job is listed under in the job queue
success
void success()Description copied from class:FloodSearchJobDeprecated, unused, see FOSJ override.- Overrides:
successin classSingleSearchJob