Class FloodSearchJob
java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.FloodSearchJob
- All Implemented Interfaces:
Job
- Direct Known Subclasses:
FloodOnlySearchJob
,IterativeSearchJob
Try sending a search to some floodfill peers, but if we don't get a successful
match within half the allowed lookup time, give up and start querying through
the normal (kademlia) channels. This should cut down on spurious lookups caused
by simple delays in responses from floodfill peers
NOTE: Unused directly - see FloodOnlySearchJob extension which overrides almost everything.
TODO: Comment out or delete what we don't use here.
Note that this does NOT extend SearchJob.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final long
protected boolean
protected long
protected final FloodfillNetworkDatabaseFacade
protected final boolean
protected final Hash
protected final Log
protected final AtomicInteger
protected boolean
protected int
protected static final int
-
Constructor Summary
ConstructorDescriptionFloodSearchJob
(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease) -
Method Summary
Modifier and TypeMethodDescription(package private) void
addDeferred
(Job onFind, Job onFailed, long timeoutMs, boolean isLease) Add jobs to an existing searchprotected int
(package private) void
failed()
Deprecated, unused, see FOSJ overridelong
System time, NOT context timelong
using context clockgetKey()
protected int
getName()
Deprecated, unused, see FOSJ overridevoid
runJob()
Deprecated, unused, see FOSJ override(package private) void
success()
Deprecated, unused, see FOSJ overrideMethods inherited from class net.i2p.router.JobImpl
dropped, getAddedBy, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, madeReady, requeue, toString
-
Field Details
-
_log
-
_facade
-
_key
-
_onFind
-
_onFailed
-
_expiration
protected long _expiration -
_timeoutMs
protected int _timeoutMs -
_isLease
protected final boolean _isLease -
_lookupsRemaining
-
_dead
protected volatile boolean _dead -
_created
protected final long _created -
_success
protected boolean _success -
CONCURRENT_SEARCHES
protected static final int CONCURRENT_SEARCHES- See Also:
-
-
Constructor Details
-
FloodSearchJob
public FloodSearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease) - Parameters:
onFind
- may be nullonFailed
- may be null
-
-
Method Details
-
getCreated
public long getCreated()System time, NOT context time -
addDeferred
Add jobs to an existing search- Parameters:
onFind
- may be nullonFailed
- may be nulltimeoutMs
- ignoredisLease
- ignored
-
getExpiration
public long getExpiration()using context clock -
runJob
public void runJob()Deprecated, unused, see FOSJ override -
getName
Deprecated, unused, see FOSJ override -
getKey
-
decrementRemaining
protected int decrementRemaining()- Returns:
- number remaining after decrementing
-
getLookupsRemaining
protected int getLookupsRemaining() -
failed
void failed()Deprecated, unused, see FOSJ override -
success
void success()Deprecated, unused, see FOSJ override
-