Module org.elasticsearch.server
Class ReservedStateUpdateTaskExecutor
java.lang.Object
org.elasticsearch.cluster.SimpleBatchedExecutor<ReservedStateUpdateTask,Void>
org.elasticsearch.reservedstate.service.ReservedStateUpdateTaskExecutor
- All Implemented Interfaces:
ClusterStateTaskExecutor<ReservedStateUpdateTask>
public class ReservedStateUpdateTaskExecutor
extends SimpleBatchedExecutor<ReservedStateUpdateTask,Void>
Reserved cluster state update task executor
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.ClusterStateTaskExecutor
ClusterStateTaskExecutor.BatchExecutionContext<T extends ClusterStateTaskListener>, ClusterStateTaskExecutor.TaskContext<T extends ClusterStateTaskListener>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called after the new cluster state is published.executeTask
(ReservedStateUpdateTask task, ClusterState clusterState) Executes the provided task from the batch.void
taskSucceeded
(ReservedStateUpdateTask task, Void unused) Called if executing a task in the batch finished successfully, and before the execution of the next task in the batch.Methods inherited from class org.elasticsearch.cluster.SimpleBatchedExecutor
afterBatchExecution, clusterStatePublished, execute
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.ClusterStateTaskExecutor
describeTasks, runOnlyOnMaster
-
Constructor Details
-
ReservedStateUpdateTaskExecutor
-
-
Method Details
-
executeTask
public Tuple<ClusterState,Void> executeTask(ReservedStateUpdateTask task, ClusterState clusterState) Description copied from class:SimpleBatchedExecutor
Executes the provided task from the batch.- Specified by:
executeTask
in classSimpleBatchedExecutor<ReservedStateUpdateTask,
Void> - Parameters:
task
- The task to be executed.clusterState
- The cluster state on which the task should be executed.- Returns:
- A tuple consisting of the resulting cluster state after executing this task, and the result of the task execution.
The returned cluster state serves as the cluster state on which the next task in the batch will run. The returned
task result is provided to the
SimpleBatchedExecutor.taskSucceeded(Task, TaskResult)
implementation.
-
taskSucceeded
Description copied from class:SimpleBatchedExecutor
Called if executing a task in the batch finished successfully, and before the execution of the next task in the batch.- Specified by:
taskSucceeded
in classSimpleBatchedExecutor<ReservedStateUpdateTask,
Void> - Parameters:
task
- The task that successfully finished execution.unused
- The result returned from the successful execution of the task.
-
clusterStatePublished
public void clusterStatePublished()Description copied from class:SimpleBatchedExecutor
Called after the new cluster state is published. Note that this method is not invoked if the cluster state was not updated.- Overrides:
clusterStatePublished
in classSimpleBatchedExecutor<ReservedStateUpdateTask,
Void>
-