All Implemented Interfaces:
Job
Direct Known Subclasses:
DirectLookupJob, SingleSearchJob

abstract class FloodOnlySearchJobextends FloodSearchJob
Flood-only search implementation for network database lookups.

Sends search queries to floodfill peers with no fallback to Kademlia search. Fails completely if no successful match is received from initial peers. Includes enhancements to help routers bootstrap back into the network after losing floodfill references by following floodfill keys in DatabaseSearchReplyMessages.

  • Field Details

    • _shouldProcessDSRM

      private boolean _shouldProcessDSRM
      Whether a search reply should be processed.
    • _unheardFrom

      private final HashSet<Hash> _unheardFrom
      Peers that did not answer this search.
    • _out

      private OutNetMessage _out
      This is a marker to register with the MessageRegistry, it is never sent.
    • _replySelector

      protected final MessageSelector _replySelector
      Reply message selector.
    • _onReply

      protected final ReplyJob _onReply
      Job to run on reply.
    • _onTimeout

      protected final Job _onTimeout
      Job to run on timeout.
  • Constructor Details

    • FloodOnlySearchJob

      public FloodOnlySearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease)
      Flood-only search for the given key against the floodfill network database.
      Parameters:
      ctx - the router context
      facade - the floodfill network database facade
      key - the hash key to search for
      onFind - job to run on successful find
      onFailed - job to run on failure
      timeoutMs - the timeout in milliseconds
      isLease - true if searching for a lease set
    • FloodOnlySearchJob

      protected FloodOnlySearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs)
      For DirectLookupJob extension, RI only, different match job.
      Parameters:
      ctx - the router context
      facade - the floodfill network database facade
      key - the hash key to search for
      onFind - job to run on successful find
      onFailed - job to run on failure
      timeoutMs - the timeout in milliseconds
  • Method Details

    • shouldProcessDSRM

      public boolean shouldProcessDSRM()
      Whether a DSRM reply should be processed.
      Returns:
      true if DSRM should be processed
    • runJob

      public void runJob()
      Description copied from class: FloodSearchJob
      Deprecated, unused, see FOSJ override.
      Specified by:
      runJob in interface Job
      Overrides:
      runJob in class FloodSearchJob
    • getName

      public String getName()
      Description copied from class: FloodSearchJob
      Deprecated, unused, see FOSJ override.
      Specified by:
      getName in interface Job
      Overrides:
      getName in class FloodSearchJob
      Returns:
      the fixed descriptive name "NetDb Search (phase 1)" of this job
    • decrementRemaining

      int decrementRemaining(Hash peer)
      Note that we heard from the peer.
      Parameters:
      peer - the peer hash
      Returns:
      number remaining after decrementing
    • failed

      void failed()
      Description copied from class: FloodSearchJob
      Deprecated, unused, see FOSJ override.
      Overrides:
      failed in class FloodSearchJob
    • success

      void success()
      Description copied from class: FloodSearchJob
      Deprecated, unused, see FOSJ override.
      Overrides:
      success in class FloodSearchJob