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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCleanup
(Runnable runnable) void
close()
void
delayUntilRecoveryStart
(SubscribableListener<Void> listener) getClusterStateDelayListener
(long clusterStateVersion) void
-
Constructor Details
-
RecoveryClusterStateDelayListeners
public RecoveryClusterStateDelayListeners(long initialClusterStateVersion)
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.elasticsearch.core.Releasable
-
addCleanup
-
getClusterStateDelayListener
-
onStartRecovery
public void onStartRecovery() -
delayUntilRecoveryStart
-