Class ShardStateAction.ShardStartedClusterStateTaskExecutor
java.lang.Object
org.elasticsearch.cluster.action.shard.ShardStateAction.ShardStartedClusterStateTaskExecutor
- All Implemented Interfaces:
ClusterStateTaskExecutor<ShardStateAction.StartedShardEntry>
,ClusterStateTaskListener
- Enclosing class:
- ShardStateAction
public static class ShardStateAction.ShardStartedClusterStateTaskExecutor
extends Object
implements ClusterStateTaskExecutor<ShardStateAction.StartedShardEntry>, ClusterStateTaskListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.ClusterStateTaskExecutor
ClusterStateTaskExecutor.ClusterTasksResult<T>, ClusterStateTaskExecutor.TaskResult
-
Constructor Summary
ConstructorDescriptionShardStartedClusterStateTaskExecutor
(AllocationService allocationService, RerouteService rerouteService, Supplier<Priority> prioritySupplier, org.apache.logging.log4j.Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clusterStatePublished
(ClusterStatePublicationEvent clusterStatePublicationEvent) Callback invoked after new cluster state is published.execute
(ClusterState currentState, List<ShardStateAction.StartedShardEntry> tasks) Update the cluster state based on the current state and the given tasks.void
A callback for when task execution fails.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.cluster.ClusterStateTaskExecutor
describeTasks, runOnlyOnMaster
Methods inherited from interface org.elasticsearch.cluster.ClusterStateTaskListener
clusterStateProcessed, onNoLongerMaster
-
Constructor Details
-
ShardStartedClusterStateTaskExecutor
public ShardStartedClusterStateTaskExecutor(AllocationService allocationService, RerouteService rerouteService, Supplier<Priority> prioritySupplier, org.apache.logging.log4j.Logger logger)
-
-
Method Details
-
execute
public ClusterStateTaskExecutor.ClusterTasksResult<ShardStateAction.StartedShardEntry> execute(ClusterState currentState, List<ShardStateAction.StartedShardEntry> tasks) throws Exception Description copied from interface:ClusterStateTaskExecutor
Update the cluster state based on the current state and the given tasks. Return the *same instance* if no state should be changed.- Specified by:
execute
in interfaceClusterStateTaskExecutor<ShardStateAction.StartedShardEntry>
- Throws:
Exception
-
onFailure
Description copied from interface:ClusterStateTaskListener
A callback for when task execution fails. 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.- Specified by:
onFailure
in interfaceClusterStateTaskListener
-
clusterStatePublished
Description copied from interface:ClusterStateTaskExecutor
Callback invoked after new cluster state is published. Note that this method is not invoked if the cluster state was not updated. Note that this method will be executed using system context.- Specified by:
clusterStatePublished
in interfaceClusterStateTaskExecutor<ShardStateAction.StartedShardEntry>
- Parameters:
clusterStatePublicationEvent
- the change event for this cluster state publication, containing both old and new states
-