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_createdprotected boolean_deadprotected long_expirationprotected FloodfillNetworkDatabaseFacade_facadeprotected boolean_isLeaseprotected Hash_keyprotected Log_logprotected AtomicInteger_lookupsRemainingprotected List<Job>_onFailedprotected List<Job>_onFindprotected boolean_successprotected int_timeoutMsprotected static intCONCURRENT_SEARCHES
-
Constructor Summary
Constructors Constructor Description FloodSearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddDeferred(Job onFind, Job onFailed, long timeoutMs, boolean isLease)Add jobs to an existing searchprotected intdecrementRemaining()(package private) voidfailed()Deprecated, unused, see FOSJ overridelonggetCreated()System time, NOT context timelonggetExpiration()using context clockprotected HashgetKey()protected intgetLookupsRemaining()StringgetName()Deprecated, unused, see FOSJ overridevoidrunJob()Deprecated, unused, see FOSJ override(package private) voidsuccess()Deprecated, unused, see FOSJ override-
Methods inherited from class net.i2p.router.JobImpl
dropped, getAddedBy, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toString
-
-
-
-
Field Detail
-
_log
protected final Log _log
-
_facade
protected final FloodfillNetworkDatabaseFacade _facade
-
_key
protected final Hash _key
-
_expiration
protected long _expiration
-
_timeoutMs
protected int _timeoutMs
-
_isLease
protected final boolean _isLease
-
_lookupsRemaining
protected final AtomicInteger _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 Detail
-
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 Detail
-
getCreated
public long getCreated()
System time, NOT context time
-
addDeferred
void addDeferred(Job onFind, Job onFailed, long timeoutMs, boolean isLease)
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
public String getName()
Deprecated, unused, see FOSJ override
-
getKey
protected Hash 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
-
-