Package org.elasticsearch.cluster
Interface ClusterStateTaskExecutor<T>
- All Known Implementing Classes:
AckedClusterStateUpdateTask
,ClusterStateUpdateTask
,JoinTaskExecutor
,LocalClusterUpdateTask
,NodeRemovalClusterStateTaskExecutor
,ShardStateAction.ShardFailedClusterStateTaskExecutor
,ShardStateAction.ShardStartedClusterStateTaskExecutor
,SystemIndexMetadataUpgradeService.SystemIndexMetadataUpdateTask
public interface ClusterStateTaskExecutor<T>
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Represents the result of a batched execution of cluster state update tasksstatic class
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
clusterStatePublished(ClusterChangedEvent clusterChangedEvent)
Callback invoked after new cluster state is published.default String
describeTasks(List<T> tasks)
Builds a concise description of a list of tasks (to be used in logging etc.).execute(ClusterState currentState, List<T> tasks)
Update the cluster state based on the current state and the given tasks.default boolean
indicates whether this executor should only run if the current node is master
-
Method Details
-
execute
ClusterStateTaskExecutor.ClusterTasksResult<T> execute(ClusterState currentState, List<T> tasks) throws ExceptionUpdate the cluster state based on the current state and the given tasks. Return the *same instance* if no state should be changed.- Throws:
Exception
-
runOnlyOnMaster
default boolean runOnlyOnMaster()indicates whether this executor should only run if the current node is master -
clusterStatePublished
Callback invoked after new cluster state is published. Note that this method is not invoked if the cluster state was not updated. Note that this method will be executed using system context.- Parameters:
clusterChangedEvent
- the change event for this cluster state change, containing both old and new states
-
describeTasks
Builds a concise description of a list of tasks (to be used in logging etc.). Note that the tasks given are not necessarily the same as those that will be passed toexecute(ClusterState, List)
. but are guaranteed to be a subset of them. This method can be called multiple times with different lists before execution. This allows groupd task description but the submitting source.
-