Package org.elasticsearch.upgrades
Class MigrationResultsUpdateTask
java.lang.Object
org.elasticsearch.cluster.ClusterStateUpdateTask
org.elasticsearch.upgrades.MigrationResultsUpdateTask
- All Implemented Interfaces:
ClusterStateTaskConfig,ClusterStateTaskListener
Handles updating the
FeatureMigrationResults in the cluster state.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.ClusterStateTaskConfig
ClusterStateTaskConfig.Basic -
Method Summary
Modifier and TypeMethodDescriptionvoidclusterStateProcessed(ClusterState oldState, ClusterState newState) Called when the result of theClusterStateTaskExecutor.execute(ClusterState, List)have been processed properly by all listeners.execute(ClusterState currentState) Computes the cluster state that results from executing this task on the given state.voidA callback for when task execution fails.voidsubmit(ClusterService clusterService) Submit the update task so that it will actually be executed.static MigrationResultsUpdateTaskupsert(String featureName, SingleFeatureMigrationResult status, ActionListener<ClusterState> listener) Creates a task that will update the status of a feature migration.Methods inherited from class org.elasticsearch.cluster.ClusterStateUpdateTask
priority, timeoutMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.cluster.ClusterStateTaskListener
onNoLongerMaster
-
Method Details
-
upsert
public static MigrationResultsUpdateTask upsert(String featureName, SingleFeatureMigrationResult status, ActionListener<ClusterState> listener) Creates a task that will update the status of a feature migration.- Parameters:
featureName- The name of the feature whose status should be updated.status- The status to be associated with the given feature.listener- A listener that will be called upon successfully updating the cluster state.
-
submit
Submit the update task so that it will actually be executed.- Parameters:
clusterService- The cluster service to which this task should be submitted.
-
execute
Description copied from class:ClusterStateUpdateTaskComputes the cluster state that results from executing this task on the given state. Returns the *same instance* if no change is required, which is an important and valuable optimisation since it short-circuits the whole publication process and saves a bunch of time and effort.- Specified by:
executein classClusterStateUpdateTask- Throws:
Exception
-
clusterStateProcessed
Description copied from interface:ClusterStateTaskListenerCalled when the result of theClusterStateTaskExecutor.execute(ClusterState, List)have been processed properly by all listeners. Implementations of this callback must not throw exceptions: an exception thrown here is logged by the master service atERRORlevel 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. -
onFailure
Description copied from class:ClusterStateUpdateTaskA callback for when task execution fails.Implementations of this callback should not throw exceptions: an exception thrown here is logged by the master service at
ERRORlevel 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- Specified by:
onFailurein classClusterStateUpdateTask
-