Class MigrationResultsUpdateTask

java.lang.Object
org.elasticsearch.cluster.ClusterStateUpdateTask
org.elasticsearch.upgrades.MigrationResultsUpdateTask
All Implemented Interfaces:
ClusterStateTaskConfig, ClusterStateTaskExecutor<ClusterStateUpdateTask>, ClusterStateTaskListener

public class MigrationResultsUpdateTask extends ClusterStateUpdateTask
Handles updating the FeatureMigrationResults in the cluster state.
  • 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

      public void submit(ClusterService clusterService)
      Submit the update task so that it will actually be executed.
      Parameters:
      clusterService - The cluster service to which this task should be submitted.
    • execute

      public ClusterState execute(ClusterState currentState) throws Exception
      Description copied from class: ClusterStateUpdateTask
      Update the cluster state based on the current state. Return the *same instance* if no state should be changed.
      Specified by:
      execute in class ClusterStateUpdateTask
      Throws:
      Exception
    • clusterStateProcessed

      public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState)
      Description copied from interface: ClusterStateTaskListener
      Called when the result of the ClusterStateTaskExecutor.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 at ERROR level and otherwise ignored, except in tests where it raises an AssertionError. 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

      public void onFailure(String source, Exception clusterStateUpdateException)
      Description copied from class: ClusterStateUpdateTask
      A 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 ERROR level 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:
      onFailure in interface ClusterStateTaskListener
      Specified by:
      onFailure in class ClusterStateUpdateTask