Class HealthPeriodicLogger

java.lang.Object
org.elasticsearch.health.HealthPeriodicLogger
All Implemented Interfaces:
Closeable, AutoCloseable, ClusterStateListener, SchedulerEngine.Listener

public class HealthPeriodicLogger extends Object implements ClusterStateListener, Closeable, SchedulerEngine.Listener
This class periodically logs the results of the Health API to the standard Elasticsearch server log file.
  • Field Details

  • Method Details

    • create

      public static HealthPeriodicLogger create(Settings settings, ClusterService clusterService, Client client, HealthService healthService)
      Creates a new HealthPeriodicLogger. This creates a scheduled job using the SchedulerEngine framework and runs it on the current health node.
      Parameters:
      settings - the cluster settings, used to get the interval setting.
      clusterService - the cluster service, used to know when the health node changes.
      client - the client used to call the Health Service.
      healthService - the Health Service, where the actual Health API logic lives.
    • clusterChanged

      public void clusterChanged(ClusterChangedEvent event)
      Description copied from interface: ClusterStateListener
      Called when cluster state changes.

      Cluster states are applied one-by-one which means they can be a performance bottleneck. Implementations of this method should therefore be fast, so please consider forking work into the background rather than doing everything inline.

      Specified by:
      clusterChanged in interface ClusterStateListener
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • triggered

      public void triggered(SchedulerEngine.Event event)
      Specified by:
      triggered in interface SchedulerEngine.Listener