abstract class FloodSearchJob extends JobImpl
Implements flood-based search strategy sending queries to floodfill peers. If no successful match is received within half the allowed timeout, falls back to standard Kademlia iterative search through normal channels. This reduces spurious lookups caused by response delays from floodfill peers.
Note: Unused directly - see FloodOnlySearchJob extension which overrides almost everything. This does NOT extend SearchJob.
| Modifier and Type | Field and 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 and Description |
|---|
FloodSearchJob(RouterContext ctx,
FloodfillNetworkDatabaseFacade facade,
Hash key,
Job onFind,
Job onFailed,
int timeoutMs,
boolean isLease) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addDeferred(Job onFind,
Job onFailed,
long timeoutMs,
boolean isLease)
Add jobs to an existing search
|
protected int |
decrementRemaining() |
(package private) void |
failed()
Deprecated, unused, see FOSJ override
|
long |
getCreated()
System time, NOT context time
|
long |
getExpiration()
using context clock
|
Hash |
getKey() |
protected int |
getLookupsRemaining() |
String |
getName()
Deprecated, unused, see FOSJ override
|
void |
runJob()
Deprecated, unused, see FOSJ override
|
(package private) void |
success()
Deprecated, unused, see FOSJ override
|
dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringprotected final long _created
protected volatile boolean _dead
protected long _expiration
protected final FloodfillNetworkDatabaseFacade _facade
protected final boolean _isLease
protected final Hash _key
protected final Log _log
protected final AtomicInteger _lookupsRemaining
protected boolean _success
protected int _timeoutMs
protected static final int CONCURRENT_SEARCHES
public FloodSearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease)
onFind - may be nullonFailed - may be nullvoid addDeferred(Job onFind, Job onFailed, long timeoutMs, boolean isLease)
onFind - may be nullonFailed - may be nulltimeoutMs - ignoredisLease - ignoredprotected int decrementRemaining()
void failed()
public long getCreated()
public long getExpiration()
public Hash getKey()
protected int getLookupsRemaining()
public String getName()
public void runJob()
void success()