public class ReplicationOperation<Request extends ReplicationRequest<Request>,ReplicaRequest extends ReplicationRequest<ReplicaRequest>,PrimaryResultT extends ReplicationOperation.PrimaryResult<ReplicaRequest>>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
ReplicationOperation.Primary<Request extends ReplicationRequest<Request>,ReplicaRequest extends ReplicationRequest<ReplicaRequest>,PrimaryResultT extends ReplicationOperation.PrimaryResult<ReplicaRequest>> |
static interface |
ReplicationOperation.PrimaryResult<R extends ReplicationRequest<R>> |
static interface |
ReplicationOperation.Replicas<ReplicaRequest extends ReplicationRequest<ReplicaRequest>> |
static class |
ReplicationOperation.RetryOnPrimaryException |
Modifier and Type | Field and Description |
---|---|
protected ActionListener<PrimaryResultT> |
resultListener |
Constructor and Description |
---|
ReplicationOperation(Request request,
ReplicationOperation.Primary<Request,ReplicaRequest,PrimaryResultT> primary,
ActionListener<PrimaryResultT> listener,
boolean executeOnReplicas,
ReplicationOperation.Replicas<ReplicaRequest> replicas,
java.util.function.Supplier<ClusterState> clusterStateSupplier,
org.apache.logging.log4j.Logger logger,
java.lang.String opType) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
checkActiveShardCount()
Checks whether we can perform a write based on the required active shard count setting.
|
void |
execute() |
protected java.util.Set<java.lang.String> |
getInSyncAllocationIds(ShardId shardId,
ClusterState clusterState) |
protected java.util.List<ShardRouting> |
getShards(ShardId shardId,
ClusterState state) |
protected final ActionListener<PrimaryResultT extends ReplicationOperation.PrimaryResult<ReplicaRequest>> resultListener
public ReplicationOperation(Request request, ReplicationOperation.Primary<Request,ReplicaRequest,PrimaryResultT> primary, ActionListener<PrimaryResultT> listener, boolean executeOnReplicas, ReplicationOperation.Replicas<ReplicaRequest> replicas, java.util.function.Supplier<ClusterState> clusterStateSupplier, org.apache.logging.log4j.Logger logger, java.lang.String opType)
public void execute() throws java.lang.Exception
java.lang.Exception
protected java.lang.String checkActiveShardCount()
protected java.util.Set<java.lang.String> getInSyncAllocationIds(ShardId shardId, ClusterState clusterState)
protected java.util.List<ShardRouting> getShards(ShardId shardId, ClusterState state)