Class SystemIndexMetadataUpgradeService.SystemIndexMetadataUpdateTask

java.lang.Object
org.elasticsearch.cluster.ClusterStateUpdateTask
org.elasticsearch.cluster.metadata.SystemIndexMetadataUpgradeService.SystemIndexMetadataUpdateTask
All Implemented Interfaces:
ClusterStateTaskConfig, ClusterStateTaskListener
Enclosing class:
SystemIndexMetadataUpgradeService

public class SystemIndexMetadataUpgradeService.SystemIndexMetadataUpdateTask extends ClusterStateUpdateTask
  • Constructor Details

    • SystemIndexMetadataUpdateTask

      public SystemIndexMetadataUpdateTask()
  • Method Details

    • execute

      public ClusterState execute(ClusterState currentState) throws Exception
      Description copied from class: ClusterStateUpdateTask
      Computes 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:
      execute in class ClusterStateUpdateTask
      Throws:
      Exception
    • onFailure

      public void onFailure(Exception e)
      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
    • clusterStateProcessed

      public void clusterStateProcessed(ClusterState oldState, ClusterState newState)
      Description copied from interface: ClusterStateTaskListener
      Called when the result of the ClusterStateTaskExecutor.execute(ClusterState, List) method have been processed properly by all listeners. The parameter is the state that was ultimately published. This can lead to surprising behaviour if tasks are batched together: a later task in the batch may undo or overwrite the changes made by an earlier task. In general you should prefer to ignore the published state and instead handle the success of a publication via the listener that the executor passes to ClusterStateTaskExecutor.TaskContext.success(org.elasticsearch.action.ActionListener<org.elasticsearch.cluster.ClusterState>). 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.