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 java.lang.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
Constructors Constructor Description LocalClusterUpdateTask()LocalClusterUpdateTask(Priority priority)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringdescribeTasks(java.util.List<LocalClusterUpdateTask> tasks)Builds a concise description of a list of tasks (to be used in logging etc.).abstract ClusterStateTaskExecutor.ClusterTasksResult<LocalClusterUpdateTask>execute(ClusterState currentState)ClusterStateTaskExecutor.ClusterTasksResult<LocalClusterUpdateTask>execute(ClusterState currentState, java.util.List<LocalClusterUpdateTask> tasks)Update the cluster state based on the current state and the given tasks.Prioritypriority()ThePriorityfor this cluster state update task configuration.booleanrunOnlyOnMaster()indicates whether this executor should only run if the current node is masterTimeValuetimeout()The timeout for this cluster state update task configuration.static ClusterStateTaskExecutor.ClusterTasksResult<LocalClusterUpdateTask>unchanged()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 Detail
-
LocalClusterUpdateTask
public LocalClusterUpdateTask()
-
LocalClusterUpdateTask
public LocalClusterUpdateTask(Priority priority)
-
-
Method Detail
-
execute
public abstract ClusterStateTaskExecutor.ClusterTasksResult<LocalClusterUpdateTask> execute(ClusterState currentState) throws java.lang.Exception
- Throws:
java.lang.Exception
-
execute
public final ClusterStateTaskExecutor.ClusterTasksResult<LocalClusterUpdateTask> execute(ClusterState currentState, java.util.List<LocalClusterUpdateTask> tasks) throws java.lang.Exception
Description 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:
java.lang.Exception
-
unchanged
public static ClusterStateTaskExecutor.ClusterTasksResult<LocalClusterUpdateTask> unchanged()
no changes were made to the cluster state. Useful to execute a runnable on the cluster state applier thread
-
describeTasks
public java.lang.String describeTasks(java.util.List<LocalClusterUpdateTask> tasks)
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 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
public Priority 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>
-
-