Class NodeRemovalClusterStateTaskExecutor
java.lang.Object
org.elasticsearch.cluster.coordination.NodeRemovalClusterStateTaskExecutor
- All Implemented Interfaces:
ClusterStateTaskExecutor<NodeRemovalClusterStateTaskExecutor.Task>
,ClusterStateTaskListener
public class NodeRemovalClusterStateTaskExecutor
extends Object
implements ClusterStateTaskExecutor<NodeRemovalClusterStateTaskExecutor.Task>, ClusterStateTaskListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.ClusterStateTaskExecutor
ClusterStateTaskExecutor.ClusterTasksResult<T>, ClusterStateTaskExecutor.TaskResult
-
Constructor Summary
ConstructorDescriptionNodeRemovalClusterStateTaskExecutor
(AllocationService allocationService, org.apache.logging.log4j.Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionexecute
(ClusterState currentState, List<NodeRemovalClusterStateTaskExecutor.Task> tasks) Update the cluster state based on the current state and the given tasks.getTaskClusterTasksResult
(ClusterState currentState, List<NodeRemovalClusterStateTaskExecutor.Task> tasks, ClusterState remainingNodesClusterState) void
A callback for when task execution fails.void
onNoLongerMaster
(String source) A callback for when the task was rejected because the processing node is no longer the elected master.protected ClusterState
remainingNodesClusterState
(ClusterState currentState, DiscoveryNodes.Builder remainingNodesBuilder) 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, describeTasks, runOnlyOnMaster
Methods 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, List<NodeRemovalClusterStateTaskExecutor.Task> tasks) throws Exception Description copied from interface:ClusterStateTaskExecutor
Update the cluster state based on the current state and the given tasks. Return the *same instance* if no state should be changed.- Specified by:
execute
in interfaceClusterStateTaskExecutor<NodeRemovalClusterStateTaskExecutor.Task>
- Throws:
Exception
-
getTaskClusterTasksResult
protected ClusterStateTaskExecutor.ClusterTasksResult<NodeRemovalClusterStateTaskExecutor.Task> getTaskClusterTasksResult(ClusterState currentState, List<NodeRemovalClusterStateTaskExecutor.Task> tasks, ClusterState remainingNodesClusterState) -
remainingNodesClusterState
protected ClusterState remainingNodesClusterState(ClusterState currentState, DiscoveryNodes.Builder remainingNodesBuilder) -
onFailure
Description copied from interface:ClusterStateTaskListener
A callback for when task execution fails. Implementations of this callback must not throw exceptions: an exception thrown here is logged by the master service atERROR
level and otherwise ignored, except in tests where it raises anAssertionError
. If log-and-ignore is the right behaviour then implementations must do so themselves, typically using a more specific logger and at a less dramatic log level.- Specified by:
onFailure
in interfaceClusterStateTaskListener
-
onNoLongerMaster
Description copied from interface:ClusterStateTaskListener
A callback for when the task was rejected because the processing node is no longer the elected master. Implementations of this callback must not throw exceptions: an exception thrown here is logged by the master service atERROR
level and otherwise ignored, except in tests where it raises anAssertionError
. If log-and-ignore is the right behaviour then implementations must do so themselves, typically using a more specific logger and at a less dramatic log level.- Specified by:
onNoLongerMaster
in interfaceClusterStateTaskListener
-