Class ReadinessService

All Implemented Interfaces:
Closeable, AutoCloseable, ClusterStateListener, LifecycleComponent, org.elasticsearch.core.Releasable

public class ReadinessService extends AbstractLifecycleComponent implements ClusterStateListener
  • Field Details

  • Constructor Details

  • Method Details

    • enabled

      public static boolean enabled(Environment environment)
      Checks to see if the readiness service is enabled in the current environment
      Parameters:
      environment -
      Returns:
    • boundAddress

      public BoundTransportAddress boundAddress()
      Returns the current bound address for the readiness service. If Elasticsearch was never ready, this method will return null.
      Returns:
      the bound address for the readiness service
    • doStart

      protected void doStart()
      Specified by:
      doStart in class AbstractLifecycleComponent
    • doStop

      protected void doStop()
      Specified by:
      doStop in class AbstractLifecycleComponent
    • doClose

      protected void doClose()
      Specified by:
      doClose in class AbstractLifecycleComponent
    • 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
    • addBoundAddressListener

      public void addBoundAddressListener(ReadinessService.BoundAddressListener listener)
      Add a listener for bound readiness service address.
      Parameters:
      listener -