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.BasicNested classes/interfaces inherited from interface org.elasticsearch.cluster.ClusterStateTaskExecutor
ClusterStateTaskExecutor.ClusterTasksResult<T>, ClusterStateTaskExecutor.TaskResult -
Constructor Summary
Constructors -
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()ThePriorityfor this cluster state update task configuration.booleanindicates whether this executor should only run if the current node is masterorg.elasticsearch.core.TimeValuetimeout()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, waitMethods inherited from interface org.elasticsearch.cluster.ClusterStateTaskExecutor
clusterStatePublishedMethods 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:ClusterStateTaskExecutorUpdate the cluster state based on the current state and the given tasks. Return the *same instance* if no state should be changed.- Specified by:
executein 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:ClusterStateTaskExecutorBuilds 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:
describeTasksin interfaceClusterStateTaskExecutor<LocalClusterUpdateTask>
-
timeout
@Nullable public org.elasticsearch.core.TimeValue timeout()Description copied from interface:ClusterStateTaskConfigThe 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:
timeoutin interfaceClusterStateTaskConfig- Returns:
- the timeout, or null if one is not set
-
priority
Description copied from interface:ClusterStateTaskConfigThePriorityfor this cluster state update task configuration.- Specified by:
priorityin interfaceClusterStateTaskConfig- Returns:
- the priority
-
runOnlyOnMaster
public final boolean runOnlyOnMaster()Description copied from interface:ClusterStateTaskExecutorindicates whether this executor should only run if the current node is master- Specified by:
runOnlyOnMasterin interfaceClusterStateTaskExecutor<LocalClusterUpdateTask>
-