Package org.graylog2.plugin.periodical
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
doRun()
abstract int
protected abstract org.slf4j.Logger
int
abstract int
void
abstract boolean
isDaemon()
Should this periodical be run as a daemon thread?boolean
Determines if this periodical should run only on the leader node.boolean
Deprecated.void
run()
abstract boolean
Defines if this thread should be called periodically or only once on startup.abstract boolean
Start on this node? Useful to decide if to start the periodical based on local configuration.abstract boolean
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.
-
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.UseleaderOnly()
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() -
getLogger
@Nonnull protected abstract org.slf4j.Logger getLogger() -
doRun
public abstract void doRun() -
getParallelism
public int getParallelism()
-
leaderOnly()
instead.