Module org.elasticsearch.server
Class DeleteIndexClusterStateUpdateRequest
java.lang.Object
org.elasticsearch.cluster.ack.ClusterStateUpdateRequest<T>
org.elasticsearch.cluster.ack.IndicesClusterStateUpdateRequest<DeleteIndexClusterStateUpdateRequest>
org.elasticsearch.action.admin.indices.delete.DeleteIndexClusterStateUpdateRequest
- All Implemented Interfaces:
AckedRequest
,ClusterStateAckListener
,ClusterStateTaskListener
public class DeleteIndexClusterStateUpdateRequest
extends IndicesClusterStateUpdateRequest<DeleteIndexClusterStateUpdateRequest>
implements ClusterStateAckListener, ClusterStateTaskListener
Cluster state update request that allows to close one or more indices
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionboolean
mustAck
(DiscoveryNode discoveryNode) Called to determine which nodes the acknowledgement is expected from.void
Called after all the nodes have acknowledged the cluster state update request but at least one of them failed.void
Called once the acknowledgement timeout defined byAckedClusterStateUpdateTask.ackTimeout()
has expiredvoid
Called once all the nodes have acknowledged the cluster state update request.void
A callback for when task execution fails.Methods inherited from class org.elasticsearch.cluster.ack.IndicesClusterStateUpdateRequest
indices, indices
Methods inherited from class org.elasticsearch.cluster.ack.ClusterStateUpdateRequest
ackTimeout, ackTimeout, masterNodeTimeout, masterNodeTimeout
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.cluster.ClusterStateAckListener
ackTimeout
-
Constructor Details
-
DeleteIndexClusterStateUpdateRequest
-
-
Method Details
-
onFailure
Description copied from interface:ClusterStateTaskListener
A callback for when task execution fails. May receive aNotMasterException
if this node stopped being the master before this task was executed or aProcessClusterEventTimeoutException
if the task timed out before it was executed. If the task fails during execution then this method receives the corresponding exception. If the task executes successfully but the resulting cluster state publication fails then this method receives aFailedToCommitClusterStateException
. If publication fails then a new master is elected and the update might or might not take effect, depending on whether or not the newly-elected master accepted the published state that failed to be committed.Use
MasterService.isPublishFailureException(java.lang.Exception)
to detect the "expected" master failure cases if needed.Implementations of this callback must not throw exceptions: an exception thrown here is logged by the master service at
ERROR
level and otherwise ignored, except in tests where it raises anAssertionError
. If log-and-ignore is the right behaviour then implementations must do so themselves, typically using a more specific logger and at a less dramatic log level.- Specified by:
onFailure
in interfaceClusterStateTaskListener
-
mustAck
Description copied from interface:ClusterStateAckListener
Called to determine which nodes the acknowledgement is expected from. As this method will be called multiple times to determine the set of acking nodes, it is crucial for it to return consistent results: Given the same listener instance and the same node parameter, the method implementation should return the same result.- Specified by:
mustAck
in interfaceClusterStateAckListener
- Parameters:
discoveryNode
- a node- Returns:
- true if the node is expected to send ack back, false otherwise
-
onAllNodesAcked
public void onAllNodesAcked()Description copied from interface:ClusterStateAckListener
Called once all the nodes have acknowledged the cluster state update request. Must be very lightweight execution, since it gets executed on the cluster service thread.- Specified by:
onAllNodesAcked
in interfaceClusterStateAckListener
-
onAckFailure
Description copied from interface:ClusterStateAckListener
Called after all the nodes have acknowledged the cluster state update request but at least one of them failed. Must be very lightweight execution, since it gets executed on the cluster service thread.- Specified by:
onAckFailure
in interfaceClusterStateAckListener
- Parameters:
e
- optional error that might have been thrown
-
onAckTimeout
public void onAckTimeout()Description copied from interface:ClusterStateAckListener
Called once the acknowledgement timeout defined byAckedClusterStateUpdateTask.ackTimeout()
has expired- Specified by:
onAckTimeout
in interfaceClusterStateAckListener
-