Class FloodSearchJob

  • All Implemented Interfaces:
    Job
    Direct Known Subclasses:
    FloodOnlySearchJob, IterativeSearchJob

    abstract class FloodSearchJob
    extends JobImpl
    Try sending a search to some floodfill peers, but if we don't get a successful match within half the allowed lookup time, give up and start querying through the normal (kademlia) channels. This should cut down on spurious lookups caused by simple delays in responses from floodfill peers NOTE: Unused directly - see FloodOnlySearchJob extension which overrides almost everything. TODO: Comment out or delete what we don't use here. Note that this does NOT extend SearchJob.
    • Field Detail

      • _log

        protected final Log _log
      • _key

        protected final Hash _key
      • _onFind

        protected final List<Job> _onFind
      • _onFailed

        protected final List<Job> _onFailed
      • _expiration

        protected long _expiration
      • _timeoutMs

        protected int _timeoutMs
      • _isLease

        protected final boolean _isLease
      • _lookupsRemaining

        protected final AtomicInteger _lookupsRemaining
      • _dead

        protected volatile boolean _dead
      • _created

        protected final long _created
      • _success

        protected boolean _success
    • Method Detail

      • getCreated

        public long getCreated()
        System time, NOT context time
      • addDeferred

        void addDeferred​(Job onFind,
                         Job onFailed,
                         long timeoutMs,
                         boolean isLease)
        Add jobs to an existing search
        Parameters:
        onFind - may be null
        onFailed - may be null
        timeoutMs - ignored
        isLease - ignored
      • getExpiration

        public long getExpiration()
        using context clock
      • runJob

        public void runJob()
        Deprecated, unused, see FOSJ override
      • getName

        public String getName()
        Deprecated, unused, see FOSJ override
      • getKey

        protected Hash getKey()
      • decrementRemaining

        protected int decrementRemaining()
        Returns:
        number remaining after decrementing
      • getLookupsRemaining

        protected int getLookupsRemaining()
      • failed

        void failed()
        Deprecated, unused, see FOSJ override
      • success

        void success()
        Deprecated, unused, see FOSJ override