Class FloodOnlySearchJob
java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.FloodSearchJob
net.i2p.router.networkdb.kademlia.FloodOnlySearchJob
- All Implemented Interfaces:
Job
- Direct Known Subclasses:
DirectLookupJob
,SingleSearchJob
Uunused directly, replaced by IterativeSearchJob, but still extended by
SingleSearchJob.
Try sending a search to some floodfill peers, failing completely if we don't get
a match from one of those peers, with no fallback to the kademlia search
Exception (a semi-exception, since we still fail completely without fallback):
If we don't know any floodfill peers, we ask a couple of peers at random,
who will hopefully reply with some floodfill keys.
We still fail without fallback, but we then spin off a job to
ask that same random peer for the RouterInfos for those keys.
If that job succeeds, the next search should work better.
In addition, we follow the floodfill keys in the DSRM
(DatabaseSearchReplyMessage) if we know less than 4 floodfills.
These enhancements allow the router to bootstrap back into the network
after it loses (or never had) floodfill references, as long as it
knows one peer that is up.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ReplyJob
protected final Job
protected final MessageSelector
Fields inherited from class net.i2p.router.networkdb.kademlia.FloodSearchJob
_created, _dead, _expiration, _facade, _isLease, _key, _log, _lookupsRemaining, _onFailed, _onFind, _success, _timeoutMs, CONCURRENT_SEARCHES
-
Constructor Summary
ModifierConstructorDescriptionprotected
FloodOnlySearchJob
(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs) For DirectLookupJob extension, RI only, different match jobFloodOnlySearchJob
(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease) -
Method Summary
Modifier and TypeMethodDescription(package private) int
decrementRemaining
(Hash peer) Note that we heard from the peer(package private) void
failed()
Deprecated, unused, see FOSJ overridegetName()
Deprecated, unused, see FOSJ overridevoid
runJob()
Deprecated, unused, see FOSJ overrideboolean
(package private) void
success()
Deprecated, unused, see FOSJ overrideMethods inherited from class net.i2p.router.networkdb.kademlia.FloodSearchJob
addDeferred, decrementRemaining, getCreated, getExpiration, getKey, getLookupsRemaining
Methods inherited from class net.i2p.router.JobImpl
dropped, getAddedBy, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, madeReady, requeue, toString
-
Field Details
-
_replySelector
-
_onReply
-
_onTimeout
-
-
Constructor Details
-
FloodOnlySearchJob
public FloodOnlySearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease) -
FloodOnlySearchJob
protected FloodOnlySearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs) For DirectLookupJob extension, RI only, different match job- Since:
- 0.9.56
-
-
Method Details
-
shouldProcessDSRM
public boolean shouldProcessDSRM() -
runJob
public void runJob()Description copied from class:FloodSearchJob
Deprecated, unused, see FOSJ override- Specified by:
runJob
in interfaceJob
- Overrides:
runJob
in classFloodSearchJob
-
getName
Description copied from class:FloodSearchJob
Deprecated, unused, see FOSJ override- Specified by:
getName
in interfaceJob
- Overrides:
getName
in classFloodSearchJob
-
decrementRemaining
Note that we heard from the peer- Returns:
- number remaining after decrementing
-
failed
void failed()Description copied from class:FloodSearchJob
Deprecated, unused, see FOSJ override- Overrides:
failed
in classFloodSearchJob
-
success
void success()Description copied from class:FloodSearchJob
Deprecated, unused, see FOSJ override- Overrides:
success
in classFloodSearchJob
-