Class FloodOnlySearchJob

  extended by net.i2p.router.JobImpl
      extended by net.i2p.router.networkdb.kademlia.FloodSearchJob
          extended by net.i2p.router.networkdb.kademlia.FloodOnlySearchJob
All Implemented Interfaces:
Direct Known Subclasses:

 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.

Field Summary
protected  int _lookupsRemaining
protected  ReplyJob _onReply
protected  Job _onTimeout
protected  MessageSelector _replySelector
Fields inherited from class net.i2p.router.networkdb.kademlia.FloodSearchJob
_expiration, _facade, _isLease, _key, _log, _onFailed, _onFind, _origExpiration, _timeoutMs
Constructor Summary
FloodOnlySearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease)
Method Summary
(package private)  void decrementRemaining(Hash peer)
          Note that we heard from the peer
(package private)  void failed()
 long getCreated()
 java.lang.String getName()
          Descriptive name of the task
 void runJob()
          Actually perform the task.
 boolean shouldProcessDSRM()
(package private)  void success()
Methods inherited from class net.i2p.router.networkdb.kademlia.FloodSearchJob
addDeferred, decrementRemaining, 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


protected volatile int _lookupsRemaining


protected MessageSelector _replySelector


protected ReplyJob _onReply


protected Job _onTimeout
Constructor Detail


public FloodOnlySearchJob(RouterContext ctx,
                          FloodfillNetworkDatabaseFacade facade,
                          Hash key,
                          Job onFind,
                          Job onFailed,
                          int timeoutMs,
                          boolean isLease)
Method Detail


public long getCreated()


public boolean shouldProcessDSRM()


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
runJob in class FloodSearchJob


public java.lang.String getName()
Description copied from interface: Job
Descriptive name of the task

Specified by:
getName in interface Job
getName in class FloodSearchJob


void decrementRemaining(Hash peer)
Note that we heard from the peer


void failed()
failed in class FloodSearchJob


void success()
success in class FloodSearchJob