Class RecoveryClusterStateDelayListeners

java.lang.Object
org.elasticsearch.indices.recovery.RecoveryClusterStateDelayListeners
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.core.Releasable

public class RecoveryClusterStateDelayListeners extends Object implements org.elasticsearch.core.Releasable
Allows one node in an integ test to delay the application of cluster states on another node until a recovery starts, without unduly delaying other cluster states. The controlling node gets a listener for each cluster state version it applies using getClusterStateDelayListener(long) and either completes it straight away (when applying states unrelated to the recovery) or delays it with delayUntilRecoveryStart(org.elasticsearch.action.support.SubscribableListener<java.lang.Void>) and releases the delay with onStartRecovery(); meanwhile the other node gets the same listener for each cluster state commit message and uses it to delay handling the commit.
  • Constructor Details

    • RecoveryClusterStateDelayListeners

      public RecoveryClusterStateDelayListeners(long initialClusterStateVersion)
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.elasticsearch.core.Releasable
    • addCleanup

      public void addCleanup(Runnable runnable)
    • getClusterStateDelayListener

      public SubscribableListener<Void> getClusterStateDelayListener(long clusterStateVersion)
    • onStartRecovery

      public void onStartRecovery()
    • delayUntilRecoveryStart

      public void delayUntilRecoveryStart(SubscribableListener<Void> listener)