Package org.elasticsearch.cluster
Class LocalClusterUpdateTask
java.lang.Object
org.elasticsearch.cluster.LocalClusterUpdateTask
- All Implemented Interfaces:
ClusterStateTaskConfig
,ClusterStateTaskExecutor<LocalClusterUpdateTask>
,ClusterStateTaskListener
public abstract class LocalClusterUpdateTask
extends Object
implements ClusterStateTaskConfig, ClusterStateTaskExecutor<LocalClusterUpdateTask>, ClusterStateTaskListener
Used to apply state updates on nodes that are not necessarily master
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.ClusterStateTaskConfig
ClusterStateTaskConfig.Basic
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.ClusterStateTaskExecutor
ClusterStateTaskExecutor.ClusterTasksResult<T>, ClusterStateTaskExecutor.TaskResult
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondescribeTasks(List<LocalClusterUpdateTask> tasks)
Builds a concise description of a list of tasks (to be used in logging etc.).execute(ClusterState currentState)
execute(ClusterState currentState, List<LocalClusterUpdateTask> tasks)
Update the cluster state based on the current state and the given tasks.priority()
ThePriority
for this cluster state update task configuration.boolean
indicates whether this executor should only run if the current node is masterorg.elasticsearch.core.TimeValue
timeout()
The timeout for this cluster state update task configuration.no changes were made to the cluster state.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
clusterStatePublished
Methods inherited from interface org.elasticsearch.cluster.ClusterStateTaskListener
clusterStateProcessed, onFailure, onNoLongerMaster
-
Constructor Details
-
LocalClusterUpdateTask
public LocalClusterUpdateTask() -
LocalClusterUpdateTask
-
-
Method Details
-
execute
public abstract ClusterStateTaskExecutor.ClusterTasksResult<LocalClusterUpdateTask> execute(ClusterState currentState) throws Exception- Throws:
Exception
-
execute
public final ClusterStateTaskExecutor.ClusterTasksResult<LocalClusterUpdateTask> execute(ClusterState currentState, List<LocalClusterUpdateTask> tasks) throws ExceptionDescription copied from interface:ClusterStateTaskExecutor
Update the cluster state based on the current state and the given tasks. Return the *same instance* if no state should be changed.- Specified by:
execute
in interfaceClusterStateTaskExecutor<LocalClusterUpdateTask>
- Throws:
Exception
-
unchanged
no changes were made to the cluster state. Useful to execute a runnable on the cluster state applier thread -
describeTasks
Description copied from interface:ClusterStateTaskExecutor
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 toClusterStateTaskExecutor.execute(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.- Specified by:
describeTasks
in interfaceClusterStateTaskExecutor<LocalClusterUpdateTask>
-
timeout
@Nullable public org.elasticsearch.core.TimeValue timeout()Description copied from interface:ClusterStateTaskConfig
The timeout for this cluster state update task configuration. If the cluster state update task isn't processed within this timeout, the associatedClusterStateTaskListener.onFailure(String, Exception)
is invoked.- Specified by:
timeout
in interfaceClusterStateTaskConfig
- Returns:
- the timeout, or null if one is not set
-
priority
Description copied from interface:ClusterStateTaskConfig
ThePriority
for this cluster state update task configuration.- Specified by:
priority
in interfaceClusterStateTaskConfig
- Returns:
- the priority
-
runOnlyOnMaster
public final boolean runOnlyOnMaster()Description copied from interface:ClusterStateTaskExecutor
indicates whether this executor should only run if the current node is master- Specified by:
runOnlyOnMaster
in interfaceClusterStateTaskExecutor<LocalClusterUpdateTask>
-