Package org.elasticsearch.upgrades
Class SystemIndexMigrationExecutor
java.lang.Object
org.elasticsearch.persistent.PersistentTasksExecutor<SystemIndexMigrationTaskParams>
org.elasticsearch.upgrades.SystemIndexMigrationExecutor
public class SystemIndexMigrationExecutor
extends PersistentTasksExecutor<SystemIndexMigrationTaskParams>
Starts the process of migrating system indices. See
SystemIndexMigrator
for the actual migration logic.-
Field Summary
Fields inherited from class org.elasticsearch.persistent.PersistentTasksExecutor
NO_NODE_FOUND
-
Constructor Summary
ConstructorDescriptionSystemIndexMigrationExecutor
(Client client, ClusterService clusterService, SystemIndices systemIndices, MetadataUpdateSettingsService metadataUpdateSettingsService, MetadataCreateIndexService metadataCreateIndexService, IndexScopedSettings indexScopedSettings) -
Method Summary
Modifier and TypeMethodDescriptionprotected AllocatedPersistentTask
createTask
(long id, String type, String action, TaskId parentTaskId, PersistentTasksCustomMetadata.PersistentTask<SystemIndexMigrationTaskParams> taskInProgress, Map<String, String> headers) Creates a AllocatedPersistentTask for communicating with task managergetAssignment
(SystemIndexMigrationTaskParams params, Collection<DiscoveryNode> candidateNodes, ClusterState clusterState) Returns the node id where the params has to be executed,static List<NamedWriteableRegistry.Entry>
protected void
nodeOperation
(AllocatedPersistentTask task, SystemIndexMigrationTaskParams 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
-
Constructor Details
-
SystemIndexMigrationExecutor
public SystemIndexMigrationExecutor(Client client, ClusterService clusterService, SystemIndices systemIndices, MetadataUpdateSettingsService metadataUpdateSettingsService, MetadataCreateIndexService metadataCreateIndexService, IndexScopedSettings indexScopedSettings)
-
-
Method Details
-
nodeOperation
protected void nodeOperation(AllocatedPersistentTask task, SystemIndexMigrationTaskParams 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<SystemIndexMigrationTaskParams>
-
createTask
protected AllocatedPersistentTask createTask(long id, String type, String action, TaskId parentTaskId, PersistentTasksCustomMetadata.PersistentTask<SystemIndexMigrationTaskParams> taskInProgress, Map<String, String> headers) Description copied from class:PersistentTasksExecutor
Creates a AllocatedPersistentTask for communicating with task manager- Overrides:
createTask
in classPersistentTasksExecutor<SystemIndexMigrationTaskParams>
-
getAssignment
public PersistentTasksCustomMetadata.Assignment getAssignment(SystemIndexMigrationTaskParams params, Collection<DiscoveryNode> candidateNodes, ClusterState clusterState) Description copied from class:PersistentTasksExecutor
Returns the node id where the params has to be executed,The default implementation returns the least loaded data node from amongst the collection of candidate nodes
- Overrides:
getAssignment
in classPersistentTasksExecutor<SystemIndexMigrationTaskParams>
-
getNamedWriteables
-