Package org.graylog2.indexer.fieldtypes
Class IndexFieldTypePollerPeriodical
java.lang.Object
org.graylog2.plugin.periodical.Periodical
org.graylog2.indexer.fieldtypes.IndexFieldTypePollerPeriodical
- All Implemented Interfaces:
Runnable
Periodical that creates and maintains index field type information in the database.-
Constructor Summary
ConstructorsConstructorDescriptionIndexFieldTypePollerPeriodical(IndexFieldTypePoller poller, IndexFieldTypesService dbService, IndexSetService indexSetService, Indices indices, MongoIndexSet.Factory mongoIndexSetFactory, Cluster cluster, com.google.common.eventbus.EventBus eventBus, ServerStatus serverStatus, com.github.joschi.jadconfig.util.Duration fullRefreshInterval, ScheduledExecutorService scheduler) -
Method Summary
Modifier and TypeMethodDescriptionvoiddoRun()intprotected org.slf4j.LoggerintvoidRemoves the index field type data for the deleted index.voidCreates a new field type polling job for the newly created index set.voidRemoves the field type polling job for the now deleted index set.booleanisDaemon()Should this periodical be run as a daemon thread?booleanDetermines if this periodical should run only on the leader node.booleanDefines if this thread should be called periodically or only once on startup.booleanStart on this node? Useful to decide if to start the periodical based on local configuration.booleanShould this thread be stopped when a graceful shutdown is in progress? This means that stop() is called and that is no longer triggered periodically.Methods inherited from class org.graylog2.plugin.periodical.Periodical
getParallelism, initialize, masterOnly, run
-
Constructor Details
-
IndexFieldTypePollerPeriodical
@Inject public IndexFieldTypePollerPeriodical(IndexFieldTypePoller poller, IndexFieldTypesService dbService, IndexSetService indexSetService, Indices indices, MongoIndexSet.Factory mongoIndexSetFactory, Cluster cluster, com.google.common.eventbus.EventBus eventBus, ServerStatus serverStatus, @Named("index_field_type_periodical_full_refresh_interval") com.github.joschi.jadconfig.util.Duration fullRefreshInterval, @Named("daemonScheduler") ScheduledExecutorService scheduler)
-
-
Method Details
-
doRun
public void doRun()- Specified by:
doRunin classPeriodical
-
handleIndexSetCreation
Creates a new field type polling job for the newly created index set.- Parameters:
event- index set creation event
-
handleIndexSetDeletion
Removes the field type polling job for the now deleted index set.- Parameters:
event- index set deletion event
-
handleIndexDeletion
Removes the index field type data for the deleted index.- Parameters:
event- index deletion event
-
runsForever
public boolean runsForever()Description copied from class:PeriodicalDefines if this thread should be called periodically or only once on startup.- Specified by:
runsForeverin classPeriodical- Returns:
-
stopOnGracefulShutdown
public boolean stopOnGracefulShutdown()Description copied from class:PeriodicalShould this thread be stopped when a graceful shutdown is in progress? This means that stop() is called and that is no longer triggered periodically.- Specified by:
stopOnGracefulShutdownin classPeriodical- Returns:
-
leaderOnly
public boolean leaderOnly()Description copied from class:PeriodicalDetermines if this periodical should run only on the leader node.- Overrides:
leaderOnlyin classPeriodical- Returns:
false(default) if this periodical may run on every node.trueif it may run only on the leader node
-
startOnThisNode
public boolean startOnThisNode()Description copied from class:PeriodicalStart on this node? Useful to decide if to start the periodical based on local configuration.- Specified by:
startOnThisNodein classPeriodical- Returns:
-
isDaemon
public boolean isDaemon()Description copied from class:PeriodicalShould this periodical be run as a daemon thread?- Specified by:
isDaemonin classPeriodical- Returns:
-
getInitialDelaySeconds
public int getInitialDelaySeconds()- Specified by:
getInitialDelaySecondsin classPeriodical- Returns:
- Seconds to wait before starting the thread. 0 for runsForever() threads.
-
getPeriodSeconds
public int getPeriodSeconds()- Specified by:
getPeriodSecondsin classPeriodical- Returns:
- How long to wait between each execution of the thread. 0 for runsForever() threads.
-
getLogger
protected org.slf4j.Logger getLogger()- Specified by:
getLoggerin classPeriodical
-