|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.FloodSearchJob
net.i2p.router.networkdb.kademlia.IterativeSearchJob
class IterativeSearchJob
A traditional Kademlia search that continues to search when the initial lookup fails, by iteratively searching the closer-to-the-key peers returned by the query in a DSRM. Unlike traditional Kad, it doesn't stop when there are no closer keys, it keeps going until the timeout or max number of searches is reached. Differences from FloodOnlySearchJob: Chases peers in DSRM's immediately. FOSJ searches the two closest in parallel and then stops. There is no per-search timeout, only a total timeout. Here, we search one at a time, and must have a separate per-search timeout. Advantages: Much more robust than FOSJ, especially in a large network where not all floodfills are known. Longer total timeout. Halves search traffic for successful searches, as this doesn't do two sesarches in parallel like FOSJ does.
Field Summary | |
---|---|
static boolean |
DEFAULT_ENCRYPT_RI
only on fast boxes, for now |
static String |
PROP_ENCRYPT_RI
|
Fields inherited from class net.i2p.router.networkdb.kademlia.FloodSearchJob |
---|
_created, _dead, _expiration, _facade, _isLease, _key, _log, _lookupsRemaining, _onFailed, _onFind, _timeoutMs, CONCURRENT_SEARCHES |
Constructor Summary | |
---|---|
IterativeSearchJob(RouterContext ctx,
FloodfillNetworkDatabaseFacade facade,
Hash key,
Job onFind,
Job onFailed,
int timeoutMs,
boolean isLease)
Lookup using exploratory tunnels |
|
IterativeSearchJob(RouterContext ctx,
FloodfillNetworkDatabaseFacade facade,
Hash key,
Job onFind,
Job onFailed,
int timeoutMs,
boolean isLease,
Hash fromLocalDest)
Lookup using the client's tunnels. |
Method Summary | |
---|---|
(package private) void |
failed()
Total failure |
(package private) void |
failed(Hash peer,
boolean timedOut)
Note that the peer did not respond with a DSM (either a DSRM, timeout, or failure). |
Hash |
getFromHash()
Hash of the dest this query is from |
String |
getName()
Deprecated, unused, see FOSJ override |
(package private) void |
newPeerToTry(Hash peer)
A new (floodfill) peer was discovered that may have the answer. |
void |
runJob()
Deprecated, unused, see FOSJ override |
(package private) void |
success()
Deprecated, unused, see FOSJ override |
(package private) long |
timeSent(Hash peer)
When did we send the query to the peer? |
boolean |
wasQueried(Hash peer)
Did we send a request to this peer? |
Methods inherited from class net.i2p.router.networkdb.kademlia.FloodSearchJob |
---|
addDeferred, decrementRemaining, getCreated, getExpiration, getKey, getLookupsRemaining |
Methods inherited from class net.i2p.router.JobImpl |
---|
dropped, getAddedBy, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String PROP_ENCRYPT_RI
public static final boolean DEFAULT_ENCRYPT_RI
Constructor Detail |
---|
public IterativeSearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease)
public IterativeSearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease, Hash fromLocalDest)
fromLocalDest
- use these tunnels for the lookup, or null for exploratoryMethod Detail |
---|
public void runJob()
FloodSearchJob
runJob
in interface Job
runJob
in class FloodSearchJob
public String getName()
FloodSearchJob
getName
in interface Job
getName
in class FloodSearchJob
void failed(Hash peer, boolean timedOut)
timedOut
- if true, will blame the peer's profilevoid newPeerToTry(Hash peer)
peer
- may not actually be newpublic Hash getFromHash()
public boolean wasQueried(Hash peer)
long timeSent(Hash peer)
void failed()
failed
in class FloodSearchJob
void success()
FloodSearchJob
success
in class FloodSearchJob
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |