java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.FloodfillMonitorJob
All Implemented Interfaces:
Job

class FloodfillMonitorJobextends JobImpl
Simple job to monitor the floodfill pool. If we are class N or O, and meet some other criteria, we will automatically become floodfill if there aren't enough. But only change ff status every few hours to minimize ff churn.
  • Field Details

    • _log

      private final Log _log
      Logger for the floodfill monitor.
    • _facade

      private final FloodfillNetworkDatabaseFacade _facade
      The network database being monitored.
    • _lastChanged

      private long _lastChanged
      When the floodfill flag last changed.
    • _deferredFlood

      private boolean _deferredFlood
      True if the floodfill offer was deferred.
    • REQUEUE_DELAY

      private static final int REQUEUE_DELAY
      Interval between the monitor runs.
      See Also:
    • MIN_UPTIME

      private static final long MIN_UPTIME
      Uptime needed before offering as floodfill.
      See Also:
    • MIN_CHANGE_DELAY

      private static final long MIN_CHANGE_DELAY
      Time between floodfill flag changes.
      See Also:
    • MIN_FF

      private static final int MIN_FF
      Floodfills needed before we stop offering.
      See Also:
    • MAX_FF

      private static final int MAX_FF
      Floodfills at which offering stops.
      See Also:
    • autoff

      private boolean autoff
      True for the automatic floodfill offering.
  • Constructor Details

    • FloodfillMonitorJob

      public FloodfillMonitorJob(RouterContext context, FloodfillNetworkDatabaseFacade facade)
      Creates a new FloodfillMonitorJob.
      Parameters:
      context - the router context
      facade - the floodfill network database facade
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Job
      Descriptive name of the task.
      Returns:
      the descriptive name of the task
    • runJob

      public void runJob()
      Description copied from interface: Job
      Actually perform the task. This call blocks until the Job is complete.
    • shouldBeFloodfill

      private boolean shouldBeFloodfill(boolean wasFF)
      Whether we should offer as a floodfill.
      Parameters:
      wasFF - true if we were a floodfill
      Returns:
      true if we should offer