Module org.elasticsearch.server
Class HealthNodeTaskExecutor
java.lang.Object
org.elasticsearch.persistent.PersistentTasksExecutor<org.elasticsearch.health.node.selection.HealthNodeTaskParams>
org.elasticsearch.health.node.selection.HealthNodeTaskExecutor
public final class HealthNodeTaskExecutor
extends PersistentTasksExecutor<org.elasticsearch.health.node.selection.HealthNodeTaskParams>
Persistent task executor that is managing the
HealthNode
.-
Field Summary
Fields inherited from class org.elasticsearch.persistent.PersistentTasksExecutor
NO_NODE_FOUND
-
Constructor Summary
ConstructorDescriptionHealthNodeTaskExecutor
(ClusterService clusterService, PersistentTasksService persistentTasksService, Settings settings, ClusterSettings clusterSettings) -
Method Summary
Modifier and TypeMethodDescriptionprotected HealthNode
createTask
(long id, String type, String action, TaskId parentTaskId, PersistentTasksCustomMetadata.PersistentTask<org.elasticsearch.health.node.selection.HealthNodeTaskParams> taskInProgress, Map<String, String> headers) Creates a AllocatedPersistentTask for communicating with task managergetAssignment
(org.elasticsearch.health.node.selection.HealthNodeTaskParams params, Collection<DiscoveryNode> candidateNodes, ClusterState clusterState) Returns the node id from the eligible health nodesstatic List<NamedWriteableRegistry.Entry>
static List<NamedXContentRegistry.Entry>
protected void
nodeOperation
(AllocatedPersistentTask task, org.elasticsearch.health.node.selection.HealthNodeTaskParams params, PersistentTaskState state) This operation will be executed on the executor node.Methods inherited from class org.elasticsearch.persistent.PersistentTasksExecutor
getDescription, getExecutor, getTaskName, selectLeastLoadedNode, validate
-
Field Details
-
ENABLED_SETTING
-
-
Constructor Details
-
HealthNodeTaskExecutor
public HealthNodeTaskExecutor(ClusterService clusterService, PersistentTasksService persistentTasksService, Settings settings, ClusterSettings clusterSettings)
-
-
Method Details
-
nodeOperation
protected void nodeOperation(AllocatedPersistentTask task, org.elasticsearch.health.node.selection.HealthNodeTaskParams params, PersistentTaskState state) Description copied from class:PersistentTasksExecutor
This operation will be executed on the executor node.NOTE: The nodeOperation has to throw an exception, trigger task.markAsCompleted() or task.completeAndNotifyIfNeeded() methods to indicate that the persistent task has finished.
- Specified by:
nodeOperation
in classPersistentTasksExecutor<org.elasticsearch.health.node.selection.HealthNodeTaskParams>
-
createTask
protected HealthNode createTask(long id, String type, String action, TaskId parentTaskId, PersistentTasksCustomMetadata.PersistentTask<org.elasticsearch.health.node.selection.HealthNodeTaskParams> taskInProgress, Map<String, String> headers) Description copied from class:PersistentTasksExecutor
Creates a AllocatedPersistentTask for communicating with task manager- Overrides:
createTask
in classPersistentTasksExecutor<org.elasticsearch.health.node.selection.HealthNodeTaskParams>
-
getAssignment
public PersistentTasksCustomMetadata.Assignment getAssignment(org.elasticsearch.health.node.selection.HealthNodeTaskParams params, Collection<DiscoveryNode> candidateNodes, ClusterState clusterState) Returns the node id from the eligible health nodes- Overrides:
getAssignment
in classPersistentTasksExecutor<org.elasticsearch.health.node.selection.HealthNodeTaskParams>
-
getNamedXContentParsers
-
getNamedWriteables
-