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 | _createdSystem time when this search was created. |
protected boolean | _deadWhether this search has been marked as completed. |
protected long | _expirationDeadline after which the search expires. |
protected FloodfillNetworkDatabaseFacade | _facadeFloodfill network database facade. |
protected boolean | _isLeaseWhether the target is a LeaseSet lookup. |
protected Hash | _keyTarget database entry hash being searched. |
protected Log | _logClass logger. |
protected AtomicInteger | _lookupsRemainingRemaining flood lookups before fallback to iterative search. |
protected List<Job> | _onFailedCallbacks for search failure. |
protected List<Job> | _onFindCallbacks for successful search completion. |
protected boolean | _successWhether the search completed successfully. |
protected int | _timeoutMsTimeout for the search in milliseconds. |
protected static int | CONCURRENT_SEARCHESMax simultaneous flood lookups before fallback. |
| 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 - search timeout in msisLease - whether searching for lease setprotected int decrementRemaining()
void failed()
public long getCreated()
public long getExpiration()
public Hash getKey()
protected int getLookupsRemaining()
public String getName()
public void runJob()
void success()