Class AckedClusterStateUpdateTask

All Implemented Interfaces:
AckedClusterStateTaskListener, ClusterStateTaskConfig, ClusterStateTaskExecutor<ClusterStateUpdateTask>, ClusterStateTaskListener

public abstract class AckedClusterStateUpdateTask extends ClusterStateUpdateTask implements AckedClusterStateTaskListener
An extension interface to ClusterStateUpdateTask that allows to be notified when all the nodes have acknowledged a cluster state update request
  • Constructor Details

  • Method Details

    • mustAck

      public boolean mustAck(DiscoveryNode discoveryNode)
      Called to determine which nodes the acknowledgement is expected from
      Specified by:
      mustAck in interface AckedClusterStateTaskListener
      discoveryNode - a node
      true if the node is expected to send ack back, false otherwise
    • onAllNodesAcked

      public void onAllNodesAcked(@Nullable Exception e)
      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 interface AckedClusterStateTaskListener
      e - optional error that might have been thrown
    • newResponse

      protected AcknowledgedResponse newResponse(boolean acknowledged)
    • onAckTimeout

      public void onAckTimeout()
      Called once the acknowledgement timeout defined by ackTimeout() has expired
      Specified by:
      onAckTimeout in interface AckedClusterStateTaskListener
    • onFailure

      public void onFailure(String source, Exception e)
      Description copied from class: ClusterStateUpdateTask
      A callback for when task execution fails. Implementations of this callback should not throw exceptions: an exception thrown here is logged by the master service at ERROR level and otherwise ignored. If log-and-ignore is the right behaviour then implementations should do so themselves, typically using a more specific logger and at a less dramatic log level.
      Specified by:
      onFailure in interface ClusterStateTaskListener
      Specified by:
      onFailure in class ClusterStateUpdateTask
    • ackTimeout

      public final org.elasticsearch.core.TimeValue ackTimeout()
      Acknowledgement timeout, maximum time interval to wait for acknowledgements
      Specified by:
      ackTimeout in interface AckedClusterStateTaskListener