public abstract class ClusterStateUpdateTask extends java.lang.Object implements ClusterStateTaskConfig, ClusterStateTaskExecutor<ClusterStateUpdateTask>, ClusterStateTaskListener
ClusterStateTaskConfig.Basic
ClusterStateTaskExecutor.BatchResult<T>, ClusterStateTaskExecutor.TaskResult
Constructor and Description |
---|
ClusterStateUpdateTask() |
ClusterStateUpdateTask(Priority priority) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
describeTasks(java.util.List<ClusterStateUpdateTask> tasks)
Builds a concise description of a list of tasks (to be used in logging etc.).
|
abstract ClusterState |
execute(ClusterState currentState)
Update the cluster state based on the current state.
|
ClusterStateTaskExecutor.BatchResult<ClusterStateUpdateTask> |
execute(ClusterState currentState,
java.util.List<ClusterStateUpdateTask> tasks)
Update the cluster state based on the current state and the given tasks.
|
abstract void |
onFailure(java.lang.String source,
java.lang.Exception e)
A callback called when execute fails.
|
Priority |
priority()
The
Priority for this cluster state update task configuration. |
TimeValue |
timeout()
If the cluster state update task wasn't processed by the provided timeout, call
ClusterStateTaskListener.onFailure(String, Exception) . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
build, build
clusterStatePublished, runOnlyOnMaster
clusterStateProcessed, onNoLongerMaster
public ClusterStateUpdateTask()
public ClusterStateUpdateTask(Priority priority)
public final ClusterStateTaskExecutor.BatchResult<ClusterStateUpdateTask> execute(ClusterState currentState, java.util.List<ClusterStateUpdateTask> tasks) throws java.lang.Exception
ClusterStateTaskExecutor
execute
in interface ClusterStateTaskExecutor<ClusterStateUpdateTask>
java.lang.Exception
public java.lang.String describeTasks(java.util.List<ClusterStateUpdateTask> tasks)
ClusterStateTaskExecutor
ClusterStateTaskExecutor.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.describeTasks
in interface ClusterStateTaskExecutor<ClusterStateUpdateTask>
public abstract ClusterState execute(ClusterState currentState) throws java.lang.Exception
java.lang.Exception
public abstract void onFailure(java.lang.String source, java.lang.Exception e)
onFailure
in interface ClusterStateTaskListener
@Nullable public TimeValue timeout()
ClusterStateTaskListener.onFailure(String, Exception)
. May return null to indicate no timeout is needed (default).timeout
in interface ClusterStateTaskConfig
public Priority priority()
ClusterStateTaskConfig
Priority
for this cluster state update task configuration.priority
in interface ClusterStateTaskConfig