Class NodeRemovalClusterStateTaskExecutor
java.lang.Object
org.elasticsearch.cluster.coordination.NodeRemovalClusterStateTaskExecutor
- All Implemented Interfaces:
ClusterStateTaskExecutor<NodeRemovalClusterStateTaskExecutor.Task>,ClusterStateTaskListener
public class NodeRemovalClusterStateTaskExecutor extends java.lang.Object implements ClusterStateTaskExecutor<NodeRemovalClusterStateTaskExecutor.Task>, ClusterStateTaskListener
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNodeRemovalClusterStateTaskExecutor.TaskNested classes/interfaces inherited from interface org.elasticsearch.cluster.ClusterStateTaskExecutor
ClusterStateTaskExecutor.ClusterTasksResult<T>, ClusterStateTaskExecutor.TaskResult -
Constructor Summary
Constructors Constructor Description NodeRemovalClusterStateTaskExecutor(AllocationService allocationService, org.apache.logging.log4j.Logger logger) -
Method Summary
Modifier and Type Method Description ClusterStateTaskExecutor.ClusterTasksResult<NodeRemovalClusterStateTaskExecutor.Task>execute(ClusterState currentState, java.util.List<NodeRemovalClusterStateTaskExecutor.Task> tasks)Update the cluster state based on the current state and the given tasks.protected ClusterStateTaskExecutor.ClusterTasksResult<NodeRemovalClusterStateTaskExecutor.Task>getTaskClusterTasksResult(ClusterState currentState, java.util.List<NodeRemovalClusterStateTaskExecutor.Task> tasks, ClusterState remainingNodesClusterState)voidonFailure(java.lang.String source, java.lang.Exception e)A callback for when task execution fails.voidonNoLongerMaster(java.lang.String source)A callback for when the task was rejected because the processing node is no longer the elected master.protected ClusterStateremainingNodesClusterState(ClusterState currentState, DiscoveryNodes.Builder remainingNodesBuilder)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
clusterStatePublished, describeTasks, runOnlyOnMasterMethods inherited from interface org.elasticsearch.cluster.ClusterStateTaskListener
clusterStateProcessed
-
Constructor Details
-
NodeRemovalClusterStateTaskExecutor
public NodeRemovalClusterStateTaskExecutor(AllocationService allocationService, org.apache.logging.log4j.Logger logger)
-
-
Method Details
-
execute
public ClusterStateTaskExecutor.ClusterTasksResult<NodeRemovalClusterStateTaskExecutor.Task> execute(ClusterState currentState, java.util.List<NodeRemovalClusterStateTaskExecutor.Task> tasks) throws java.lang.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<NodeRemovalClusterStateTaskExecutor.Task>- Throws:
java.lang.Exception
-
getTaskClusterTasksResult
protected ClusterStateTaskExecutor.ClusterTasksResult<NodeRemovalClusterStateTaskExecutor.Task> getTaskClusterTasksResult(ClusterState currentState, java.util.List<NodeRemovalClusterStateTaskExecutor.Task> tasks, ClusterState remainingNodesClusterState) -
remainingNodesClusterState
protected ClusterState remainingNodesClusterState(ClusterState currentState, DiscoveryNodes.Builder remainingNodesBuilder) -
onFailure
public void onFailure(java.lang.String source, java.lang.Exception e)Description copied from interface:ClusterStateTaskListenerA callback for when task execution fails. Implementations of this callback should not throw exceptions: an exception thrown here is logged by the master service atERRORlevel and otherwise ignored. If log-and-ignore is the right behaviour then implementations should do so themselves, typically using a more specific logger and at a less dramatic log level.- Specified by:
onFailurein interfaceClusterStateTaskListener
-
onNoLongerMaster
public void onNoLongerMaster(java.lang.String source)Description copied from interface:ClusterStateTaskListenerA callback for when the task was rejected because the processing node is no longer the elected master. Implementations of this callback should not throw exceptions: an exception thrown here is logged by the master service atERRORlevel and otherwise ignored. If log-and-ignore is the right behaviour then implementations should do so themselves, typically using a more specific logger and at a less dramatic log level.- Specified by:
onNoLongerMasterin interfaceClusterStateTaskListener
-