Class ActiveShardsObserver

org.elasticsearch.action.support.ActiveShardsObserver

public class ActiveShardsObserver extends
This class provides primitives for waiting for a configured number of shards to become active before sending a response on an ActionListener.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ActiveShardsObserver​(ClusterService clusterService, ThreadPool threadPool)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    [] indexNames, ActiveShardCount activeShardCount, org.elasticsearch.core.TimeValue timeout, <> onResult, <> onFailure)
    Waits on the specified number of active shards to be started before executing the

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Constructor Details

  • Method Details

    • waitForActiveShards

      public void waitForActiveShards([] indexNames, ActiveShardCount activeShardCount, org.elasticsearch.core.TimeValue timeout, <> onResult, <> onFailure)
      Waits on the specified number of active shards to be started before executing the
      Parameters:
      indexNames - the indices to wait for active shards on
      activeShardCount - the number of active shards to wait on before returning
      timeout - the timeout value
      onResult - a function that is executed in response to the requisite shards becoming active or a timeout (whichever comes first)
      onFailure - a function that is executed in response to an error occurring during waiting for the active shards