Class ClusterStateObserver

java.lang.Object
org.elasticsearch.cluster.ClusterStateObserver

public class ClusterStateObserver
extends java.lang.Object
A utility class which simplifies interacting with the cluster state in cases where one tries to take action based on the current state but may want to wait for a new state and retry upon failure.
  • Field Details

    • logger

      protected final org.apache.logging.log4j.Logger logger
  • Constructor Details

    • ClusterStateObserver

      public ClusterStateObserver​(ClusterService clusterService, org.apache.logging.log4j.Logger logger, ThreadContext contextHolder)
    • ClusterStateObserver

      public ClusterStateObserver​(ClusterService clusterService, @Nullable org.elasticsearch.common.unit.TimeValue timeout, org.apache.logging.log4j.Logger logger, ThreadContext contextHolder)
      Parameters:
      timeout - a global timeout for this observer. After it has expired the observer will fail any existing or new #waitForNextChange calls. Set to null to wait indefinitely
    • ClusterStateObserver

      public ClusterStateObserver​(ClusterState initialState, ClusterService clusterService, @Nullable org.elasticsearch.common.unit.TimeValue timeout, org.apache.logging.log4j.Logger logger, ThreadContext contextHolder)
      Parameters:
      timeout - a global timeout for this observer. After it has expired the observer will fail any existing or new #waitForNextChange calls. Set to null to wait indefinitely
    • ClusterStateObserver

      public ClusterStateObserver​(ClusterState initialState, ClusterApplierService clusterApplierService, @Nullable org.elasticsearch.common.unit.TimeValue timeout, org.apache.logging.log4j.Logger logger, ThreadContext contextHolder)
  • Method Details