Module org.elasticsearch.server
Class HealthNodeTaskExecutor
java.lang.Object
org.elasticsearch.persistent.PersistentTasksExecutor<HealthNodeTaskParams>
org.elasticsearch.health.node.selection.HealthNodeTaskExecutor
Persistent task executor that is managing the
HealthNode
.-
Field Summary
Fields inherited from class org.elasticsearch.persistent.PersistentTasksExecutor
NO_NODE_FOUND
-
Method Summary
Modifier and TypeMethodDescriptionstatic HealthNodeTaskExecutor
create
(ClusterService clusterService, PersistentTasksService persistentTasksService, FeatureService featureService, Settings settings, ClusterSettings clusterSettings) protected HealthNode
createTask
(long id, String type, String action, TaskId parentTaskId, PersistentTasksCustomMetadata.PersistentTask<HealthNodeTaskParams> taskInProgress, Map<String, String> headers) Creates a AllocatedPersistentTask for communicating with task managergetAssignment
(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, 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
-
-
Method Details
-
create
public static HealthNodeTaskExecutor create(ClusterService clusterService, PersistentTasksService persistentTasksService, FeatureService featureService, Settings settings, ClusterSettings clusterSettings) -
nodeOperation
protected void nodeOperation(AllocatedPersistentTask task, 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<HealthNodeTaskParams>
-
createTask
protected HealthNode createTask(long id, String type, String action, TaskId parentTaskId, PersistentTasksCustomMetadata.PersistentTask<HealthNodeTaskParams> taskInProgress, Map<String, String> headers) Description copied from class:PersistentTasksExecutor
Creates a AllocatedPersistentTask for communicating with task manager- Overrides:
createTask
in classPersistentTasksExecutor<HealthNodeTaskParams>
-
getAssignment
public PersistentTasksCustomMetadata.Assignment getAssignment(HealthNodeTaskParams params, Collection<DiscoveryNode> candidateNodes, ClusterState clusterState) Returns the node id from the eligible health nodes- Overrides:
getAssignment
in classPersistentTasksExecutor<HealthNodeTaskParams>
-
getNamedXContentParsers
-
getNamedWriteables
-