public abstract class AckedClusterStateUpdateTask<Response> extends ClusterStateUpdateTask implements AckedClusterStateTaskListener
ClusterStateUpdateTask
that allows to be notified when
all the nodes have acknowledged a cluster state update requestClusterStateTaskConfig.Basic
ClusterStateTaskExecutor.BatchResult<T>, ClusterStateTaskExecutor.TaskResult
Modifier | Constructor and Description |
---|---|
protected |
AckedClusterStateUpdateTask(AckedRequest request,
ActionListener<Response> listener) |
protected |
AckedClusterStateUpdateTask(Priority priority,
AckedRequest request,
ActionListener<Response> listener) |
Modifier and Type | Method and Description |
---|---|
TimeValue |
ackTimeout()
Acknowledgement timeout, maximum time interval to wait for acknowledgements
|
boolean |
mustAck(DiscoveryNode discoveryNode)
Called to determine which nodes the acknowledgement is expected from
|
protected abstract Response |
newResponse(boolean acknowledged) |
void |
onAckTimeout()
Called once the acknowledgement timeout defined by
ackTimeout() has expired |
void |
onAllNodesAcked(java.lang.Throwable t)
Called once all the nodes have acknowledged the cluster state update request.
|
void |
onFailure(java.lang.String source,
java.lang.Throwable t)
A callback called when execute fails.
|
TimeValue |
timeout()
If the cluster state update task wasn't processed by the provided timeout, call
ClusterStateUpdateTask.onFailure(String, Throwable) . |
execute, execute, priority
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clusterStateProcessed, onNoLongerMaster
build, build
clusterStatePublished, runOnlyOnMaster
protected AckedClusterStateUpdateTask(AckedRequest request, ActionListener<Response> listener)
protected AckedClusterStateUpdateTask(Priority priority, AckedRequest request, ActionListener<Response> listener)
public boolean mustAck(DiscoveryNode discoveryNode)
mustAck
in interface AckedClusterStateTaskListener
discoveryNode
- a nodepublic void onAllNodesAcked(@Nullable java.lang.Throwable t)
onAllNodesAcked
in interface AckedClusterStateTaskListener
t
- optional error that might have been thrownprotected abstract Response newResponse(boolean acknowledged)
public void onAckTimeout()
ackTimeout()
has expiredonAckTimeout
in interface AckedClusterStateTaskListener
public void onFailure(java.lang.String source, java.lang.Throwable t)
ClusterStateUpdateTask
onFailure
in interface ClusterStateTaskListener
onFailure
in class ClusterStateUpdateTask
public TimeValue ackTimeout()
ackTimeout
in interface AckedClusterStateTaskListener
public TimeValue timeout()
ClusterStateUpdateTask
ClusterStateUpdateTask.onFailure(String, Throwable)
. May return null to indicate no timeout is needed (default).timeout
in interface ClusterStateTaskConfig
timeout
in class ClusterStateUpdateTask