Class TransportWriteAction.WriteActionReplicasProxy
java.lang.Object
TransportReplicationAction<Request,ReplicaRequest,Response>.org.opensearch.action.support.replication.TransportReplicationAction.ReplicasProxy
org.opensearch.action.support.replication.TransportWriteAction.WriteActionReplicasProxy
- All Implemented Interfaces:
ReplicationOperation.Replicas<ReplicaRequest>
- Enclosing class:
TransportWriteAction<Request extends ReplicatedWriteRequest<Request>,
ReplicaRequest extends ReplicatedWriteRequest<ReplicaRequest>, Response extends ReplicationResponse & WriteResponse>
protected class TransportWriteAction.WriteActionReplicasProxy
extends TransportReplicationAction<Request,ReplicaRequest,Response>.ReplicasProxy
A proxy for write operations that need to be performed on the
replicas, where a failure to execute the operation should fail
the replica shard and/or mark the replica as stale.
This extends TransportReplicationAction.ReplicasProxy
to do the
failing and stale-ing.
- Opensearch.internal:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
failShardIfNeeded
(ShardRouting replica, long primaryTerm, String message, Exception exception, org.opensearch.core.action.ActionListener<Void> listener) Fail the specified shard if needed, removing it from the current set of active shards.void
markShardCopyAsStaleIfNeeded
(org.opensearch.core.index.shard.ShardId shardId, String allocationId, long primaryTerm, org.opensearch.core.action.ActionListener<Void> listener) Marks shard copy as stale if needed, removing its allocation id from the set of in-sync allocation ids.Methods inherited from class org.opensearch.action.support.replication.TransportReplicationAction.ReplicasProxy
performOn
-
Constructor Details
-
WriteActionReplicasProxy
protected WriteActionReplicasProxy()
-
-
Method Details
-
failShardIfNeeded
public void failShardIfNeeded(ShardRouting replica, long primaryTerm, String message, Exception exception, org.opensearch.core.action.ActionListener<Void> listener) Description copied from interface:ReplicationOperation.Replicas
Fail the specified shard if needed, removing it from the current set of active shards. Whether a failure is needed is left up to the implementation.- Specified by:
failShardIfNeeded
in interfaceReplicationOperation.Replicas<ReplicaRequest extends ReplicatedWriteRequest<ReplicaRequest>>
- Overrides:
failShardIfNeeded
in classTransportReplicationAction<Request extends ReplicatedWriteRequest<Request>,
ReplicaRequest extends ReplicatedWriteRequest<ReplicaRequest>, Response extends ReplicationResponse & WriteResponse>.ReplicasProxy - Parameters:
replica
- shard to failprimaryTerm
- the primary termmessage
- a (short) description of the reasonexception
- the original exception which caused the ReplicationOperation to request the shard to be failedlistener
- a listener that will be notified when the failing shard has been removed from the in-sync set
-
markShardCopyAsStaleIfNeeded
public void markShardCopyAsStaleIfNeeded(org.opensearch.core.index.shard.ShardId shardId, String allocationId, long primaryTerm, org.opensearch.core.action.ActionListener<Void> listener) Description copied from interface:ReplicationOperation.Replicas
Marks shard copy as stale if needed, removing its allocation id from the set of in-sync allocation ids. Whether marking as stale is needed is left up to the implementation.- Specified by:
markShardCopyAsStaleIfNeeded
in interfaceReplicationOperation.Replicas<ReplicaRequest extends ReplicatedWriteRequest<ReplicaRequest>>
- Overrides:
markShardCopyAsStaleIfNeeded
in classTransportReplicationAction<Request extends ReplicatedWriteRequest<Request>,
ReplicaRequest extends ReplicatedWriteRequest<ReplicaRequest>, Response extends ReplicationResponse & WriteResponse>.ReplicasProxy - Parameters:
shardId
- shard idallocationId
- allocation id to remove from the set of in-sync allocation idsprimaryTerm
- the primary termlistener
- a listener that will be notified when the failing shard has been removed from the in-sync set
-