Module org.elasticsearch.server
Class SystemIndexMetadataUpgradeService.SystemIndexMetadataUpdateTask
java.lang.Object
org.elasticsearch.cluster.ClusterStateUpdateTask
org.elasticsearch.cluster.metadata.SystemIndexMetadataUpgradeService.SystemIndexMetadataUpdateTask
- All Implemented Interfaces:
ClusterStateTaskListener
- Enclosing class:
- SystemIndexMetadataUpgradeService
public class SystemIndexMetadataUpgradeService.SystemIndexMetadataUpdateTask
extends ClusterStateUpdateTask
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clusterStateProcessed
(ClusterState oldState, ClusterState newState) Called when the result of theClusterStateUpdateTask.execute(org.elasticsearch.cluster.ClusterState)
method has been processed properly by all listeners.execute
(ClusterState currentState) Computes the cluster state that results from executing this task on the given state.void
A callback for when task execution fails.Methods inherited from class org.elasticsearch.cluster.ClusterStateUpdateTask
priority, timeout
-
Constructor Details
-
SystemIndexMetadataUpdateTask
public SystemIndexMetadataUpdateTask()
-
-
Method Details
-
execute
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 classClusterStateUpdateTask
- Throws:
Exception
-
onFailure
Description copied from interface:ClusterStateTaskListener
A callback for when task execution fails. May receive aNotMasterException
if this node stopped being the master before this task was executed or aProcessClusterEventTimeoutException
if the task timed out before it was executed. If the task fails during execution then this method receives the corresponding exception. If the task executes successfully but the resulting cluster state publication fails then this method receives aFailedToCommitClusterStateException
. If publication fails then a new master is elected and the update might or might not take effect, depending on whether or not the newly-elected master accepted the published state that failed to be committed.Use
MasterService.isPublishFailureException(java.lang.Exception)
to detect the "expected" master failure cases if needed.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 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. -
clusterStateProcessed
Description copied from class:ClusterStateUpdateTask
Called when the result of theClusterStateUpdateTask.execute(org.elasticsearch.cluster.ClusterState)
method has been processed properly by all listeners. The parameter is the state that was ultimately published. Implementations of this callback must not throw exceptions: an exception thrown here is logged by the master service atERROR
level 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.- Overrides:
clusterStateProcessed
in classClusterStateUpdateTask
-