net.i2p.router.networkdb.kademlia
Class FloodSearchJob
java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.FloodSearchJob
- All Implemented Interfaces:
- Job
- Direct Known Subclasses:
- FloodOnlySearchJob
public 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.
_log
protected Log _log
_facade
protected FloodfillNetworkDatabaseFacade _facade
_key
protected Hash _key
_onFind
protected final List<Job> _onFind
_onFailed
protected final List<Job> _onFailed
_expiration
protected long _expiration
_timeoutMs
protected int _timeoutMs
_origExpiration
protected long _origExpiration
_isLease
protected boolean _isLease
_lookupsRemaining
protected volatile int _lookupsRemaining
_dead
protected volatile boolean _dead
FloodSearchJob
public FloodSearchJob(RouterContext ctx,
FloodfillNetworkDatabaseFacade facade,
Hash key,
Job onFind,
Job onFailed,
int timeoutMs,
boolean isLease)
addDeferred
void addDeferred(Job onFind,
Job onFailed,
long timeoutMs,
boolean isLease)
getExpiration
public long getExpiration()
runJob
public void runJob()
- Description copied from interface:
Job
- Actually perform the task. This call blocks until the Job is complete.
getName
public String getName()
- Description copied from interface:
Job
- Descriptive name of the task
getKey
protected Hash getKey()
decrementRemaining
protected void decrementRemaining()
getLookupsRemaining
protected int getLookupsRemaining()
failed
void failed()
success
void success()