net.i2p.router.networkdb.kademlia
Class FloodOnlySearchJob
java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.FloodSearchJob
net.i2p.router.networkdb.kademlia.FloodOnlySearchJob
- All Implemented Interfaces:
- Job
- Direct Known Subclasses:
- SingleSearchJob
class FloodOnlySearchJob
- extends FloodSearchJob
Try sending a search to some floodfill peers, failing completely if we don't get
a match from one of those peers, with no fallback to the kademlia search
Exception (a semi-exception, since we still fail completely without fallback):
If we don't know any floodfill peers, we ask a couple of peers at random,
who will hopefully reply with some floodfill keys.
We still fail without fallback, but we then spin off a job to
ask that same random peer for the RouterInfos for those keys.
If that job succeeds, the next search should work better.
In addition, we follow the floodfill keys in the DSRM
(DatabaseSearchReplyMessage) if we know less than 4 floodfills.
These enhancements allow the router to bootstrap back into the network
after it loses (or never had) floodfill references, as long as it
knows one peer that is up.
_replySelector
protected MessageSelector _replySelector
_onReply
protected ReplyJob _onReply
_onTimeout
protected Job _onTimeout
FloodOnlySearchJob
public FloodOnlySearchJob(RouterContext ctx,
FloodfillNetworkDatabaseFacade facade,
Hash key,
Job onFind,
Job onFailed,
int timeoutMs,
boolean isLease)
getCreated
public long getCreated()
shouldProcessDSRM
public boolean shouldProcessDSRM()
runJob
public void runJob()
- Description copied from interface:
Job
- Actually perform the task. This call blocks until the Job is complete.
- Specified by:
runJob
in interface Job
- Overrides:
runJob
in class FloodSearchJob
getName
public String getName()
- Description copied from interface:
Job
- Descriptive name of the task
- Specified by:
getName
in interface Job
- Overrides:
getName
in class FloodSearchJob
decrementRemaining
void decrementRemaining(Hash peer)
- Note that we heard from the peer
failed
void failed()
- Overrides:
failed
in class FloodSearchJob
success
void success()
- Overrides:
success
in class FloodSearchJob