public abstract class ClusterStateUpdateTask extends ClusterStateTaskExecutor<ClusterStateUpdateTask> implements ClusterStateTaskConfig, ClusterStateTaskListener
ClusterStateTaskExecutor.BatchResult<T>, ClusterStateTaskExecutor.TaskResult
Constructor and Description |
---|
ClusterStateUpdateTask() |
ClusterStateUpdateTask(Priority priority) |
Modifier and Type | Method and Description |
---|---|
void |
clusterStateProcessed(String source,
ClusterState oldState,
ClusterState newState)
Called when the result of the
ClusterStateTaskExecutor.execute(ClusterState, List) have been processed
properly by all listeners. |
abstract ClusterState |
execute(ClusterState currentState)
Update the cluster state based on the current state.
|
ClusterStateTaskExecutor.BatchResult<ClusterStateUpdateTask> |
execute(ClusterState currentState,
List<ClusterStateUpdateTask> tasks)
Update the cluster state based on the current state and the given tasks.
|
abstract void |
onFailure(String source,
Throwable t)
A callback called when execute fails.
|
void |
onNoLongerMaster(String source)
called when the task was rejected because the local node is no longer master
|
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
onFailure(String, Throwable) . |
clusterStatePublished, runOnlyOnMaster
public ClusterStateUpdateTask()
public ClusterStateUpdateTask(Priority priority)
public final ClusterStateTaskExecutor.BatchResult<ClusterStateUpdateTask> execute(ClusterState currentState, List<ClusterStateUpdateTask> tasks) throws Exception
ClusterStateTaskExecutor
execute
in class ClusterStateTaskExecutor<ClusterStateUpdateTask>
Exception
public abstract ClusterState execute(ClusterState currentState) throws Exception
Exception
public abstract void onFailure(String source, Throwable t)
onFailure
in interface ClusterStateTaskListener
public void onNoLongerMaster(String source)
ClusterStateTaskListener
onNoLongerMaster
in interface ClusterStateTaskListener
public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState)
ClusterStateTaskListener
ClusterStateTaskExecutor.execute(ClusterState, List)
have been processed
properly by all listeners.clusterStateProcessed
in interface ClusterStateTaskListener
@Nullable public TimeValue timeout()
onFailure(String, Throwable)
. 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
Copyright © 2009–2017. All rights reserved.