Class Periodical

java.lang.Object
org.graylog2.plugin.periodical.Periodical
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
BatchedElasticSearchOutputFlushThread, ClusterEventCleanupPeriodical, ClusterEventPeriodical, ClusterHealthCheckThread, ContentPackLoaderPeriodical, ESVersionCheckPeriodical, EventNotificationStatusCleanUp, IndexBlockCheck, IndexerClusterCheckerThread, IndexFieldTypePollerPeriodical, IndexRangesCleanupPeriodical, IndexRetentionThread, IndexRotationThread, LeaderPresenceCheckPeriodical, LegacyDefaultStreamMigration, NodePingThread, PurgeExpiredConfigurationUploads, PurgeExpiredSidecarsThread, ScheduleTriggerCleanUp, SearchesCleanUpJob, TelemetryClusterInfoPeriodical, ThrottleStateUpdaterThread, ThroughputCalculator, TrafficCounterCalculator, UserSessionTerminationPeriodical, VersionCheckThread

public abstract class Periodical extends Object implements Runnable
  • Constructor Details

    • Periodical

      public Periodical()
  • Method Details

    • runsForever

      public abstract boolean runsForever()
      Defines if this thread should be called periodically or only once on startup.
      Returns:
    • stopOnGracefulShutdown

      public abstract boolean stopOnGracefulShutdown()
      Should this thread be stopped when a graceful shutdown is in progress? This means that stop() is called and that is no longer triggered periodically.
      Returns:
    • masterOnly

      @Deprecated public boolean masterOnly()
      Deprecated.
      Use leaderOnly() instead.
      Only start this thread on leader nodes?
    • leaderOnly

      public boolean leaderOnly()
      Determines if this periodical should run only on the leader node.
      Returns:
      false (default) if this periodical may run on every node. true if it may run only on the leader node
    • startOnThisNode

      public abstract boolean startOnThisNode()
      Start on this node? Useful to decide if to start the periodical based on local configuration.
      Returns:
    • isDaemon

      public abstract boolean isDaemon()
      Should this periodical be run as a daemon thread?
      Returns:
    • getInitialDelaySeconds

      public abstract int getInitialDelaySeconds()
      Returns:
      Seconds to wait before starting the thread. 0 for runsForever() threads.
    • getPeriodSeconds

      public abstract int getPeriodSeconds()
      Returns:
      How long to wait between each execution of the thread. 0 for runsForever() threads.
    • initialize

      public void initialize()
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • getLogger

      @Nonnull protected abstract org.slf4j.Logger getLogger()
    • doRun

      public abstract void doRun()
    • getParallelism

      public int getParallelism()