Class FloodSearchJob
java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.FloodSearchJob
- All Implemented Interfaces:
Job
- Direct Known Subclasses:
FloodOnlySearchJob
,IterativeSearchJob
abstract class FloodSearchJob extends JobImpl
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
Fields Modifier and Type Field Description protected long
_created
protected boolean
_dead
protected long
_expiration
protected FloodfillNetworkDatabaseFacade
_facade
protected boolean
_isLease
protected Hash
_key
protected Log
_log
protected AtomicInteger
_lookupsRemaining
protected List<Job>
_onFailed
protected List<Job>
_onFind
protected boolean
_success
protected int
_timeoutMs
protected static int
CONCURRENT_SEARCHES
-
Constructor Summary
Constructors Constructor Description FloodSearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease)
-
Method Summary
Modifier and Type Method Description (package private) void
addDeferred(Job onFind, Job onFailed, long timeoutMs, boolean isLease)
Add jobs to an existing searchprotected int
decrementRemaining()
(package private) void
failed()
Deprecated, unused, see FOSJ overridelong
getCreated()
System time, NOT context timelong
getExpiration()
using context clockprotected Hash
getKey()
protected int
getLookupsRemaining()
String
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, 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:
- Constant Field Values
-
-
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
-