Class ShardStateAction
org.elasticsearch.cluster.action.shard.ShardStateAction
public class ShardStateAction
extends
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
-
Field Summary
Modifier and TypeFieldDescriptionAdjusts the priority of the followup reroute task.static
static
-
Constructor Summary
ConstructorDescriptionShardStateAction(ClusterService clusterService, TransportService transportService, AllocationService allocationService, RerouteService rerouteService, ThreadPool threadPool)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
localShardFailed(ShardRouting shardRouting, message, failure, > listener)
Send a shard failed request to the master node to update the cluster state when a shard on the local node failed.void
localShardFailed(ShardRouting shardRouting, message, failure, > listener, ClusterState currentState)
Send a shard failed request to the master node to update the cluster state when a shard on the local node failed.void
remoteShardFailed(ShardId shardId, allocationId, long primaryTerm, boolean markAsStale, message, failure, > listener)
Send a shard failed request to the master node to update the cluster state with the failure of a shard on another node.void
shardStarted(ShardRouting shardRouting, long primaryTerm, message, ShardLongFieldRange timestampRange, > listener)
void
shardStarted(ShardRouting shardRouting, long primaryTerm, message, ShardLongFieldRange timestampRange, > listener, ClusterState currentState)
protected void
actionName, ClusterStateObserver observer, TransportRequest request, > listener, <ClusterState> changePredicate)
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Field Details
-
SHARD_STARTED_ACTION_NAME
public static final SHARD_STARTED_ACTION_NAME- See Also:
- Constant Field Values
-
SHARD_FAILED_ACTION_NAME
public static final SHARD_FAILED_ACTION_NAME- See Also:
- Constant Field Values
-
FOLLOW_UP_REROUTE_PRIORITY_SETTING
Adjusts the priority of the followup reroute task. NORMAL is right for reasonable clusters, but in a badly configured cluster it may be necessary to raise this higher to recover the older behaviour of rerouting after processing every shard-started task. Deliberately undocumented, since this is a last-resort escape hatch for experts rather than something we want to expose to anyone, and deprecated since we will remove it once we have confirmed from experience that this priority is appropriate in all cases.
-
-
Constructor Details
-
ShardStateAction
@Inject public ShardStateAction(ClusterService clusterService, TransportService transportService, AllocationService allocationService, RerouteService rerouteService, ThreadPool threadPool)
-
-
Method Details
-
remoteShardFailed
public void remoteShardFailed(ShardId shardId, allocationId, long primaryTerm, boolean markAsStale, message, @Nullable failure, > listener)Send a shard failed request to the master node to update the cluster state with the failure of a shard on another node. This means that the shard should be failed because a write made it into the primary but was not replicated to this shard copy. If the shard does not exist anymore but still has an entry in the in-sync set, remove its allocation id from the in-sync set.- Parameters:
shardId
- shard id of the shard to failallocationId
- allocation id of the shard to failprimaryTerm
- the primary term associated with the primary shard that is failing the shard. Must be strictly positive.markAsStale
- whether or not to mark a failing shard as stale (eg. removing from in-sync set) when failing the shard.message
- the reason for the failurefailure
- the underlying cause of the failurelistener
- callback upon completion of the request
-
localShardFailed
Send a shard failed request to the master node to update the cluster state when a shard on the local node failed. -
localShardFailed
public void localShardFailed(ShardRouting shardRouting, message, @Nullable failure, > listener, ClusterState currentState)Send a shard failed request to the master node to update the cluster state when a shard on the local node failed. -
waitForNewMasterAndRetry
protected void waitForNewMasterAndRetry( actionName, ClusterStateObserver observer, TransportRequest request, > listener, <ClusterState> changePredicate) -
shardStarted
public void shardStarted(ShardRouting shardRouting, long primaryTerm, message, ShardLongFieldRange timestampRange, > listener) -
shardStarted
public void shardStarted(ShardRouting shardRouting, long primaryTerm, message, ShardLongFieldRange timestampRange, > listener, ClusterState currentState)
-