public abstract class TransportReplicationAction<Request extends ReplicationRequest<Request>,ReplicaRequest extends ReplicationRequest<ReplicaRequest>,Response extends ReplicationResponse> extends TransportAction<Request,Response>
Modifier and Type | Class and Description |
---|---|
static class |
TransportReplicationAction.ConcreteShardRequest<R extends ReplicationRequest<?>>
a wrapper class to encapsulate a request when being sent to a specific allocation id
|
protected static class |
TransportReplicationAction.PrimaryResult<ReplicaRequest extends ReplicationRequest<ReplicaRequest>,Response extends ReplicationResponse> |
protected static class |
TransportReplicationAction.ReplicaResult |
static class |
TransportReplicationAction.RetryOnReplicaException |
Modifier and Type | Field and Description |
---|---|
protected ClusterService |
clusterService |
actionName, indexNameExpressionResolver, taskManager, threadPool
deprecationLogger, logger, settings
Modifier | Constructor and Description |
---|---|
protected |
TransportReplicationAction(Settings settings,
java.lang.String actionName,
TransportService transportService,
ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ShardStateAction shardStateAction,
ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver,
java.util.function.Supplier<Request> request,
java.util.function.Supplier<ReplicaRequest> replicaRequest,
java.lang.String executor) |
Modifier and Type | Method and Description |
---|---|
protected void |
doExecute(Request request,
ActionListener<Response> listener) |
protected void |
doExecute(Task task,
Request request,
ActionListener<Response> listener) |
protected ClusterBlockLevel |
globalBlockLevel()
Cluster level block to check before request execution.
|
protected ClusterBlockLevel |
indexBlockLevel()
Index level block to check before request execution.
|
protected abstract Response |
newResponseInstance() |
protected boolean |
resolveIndex()
True if provided index should be resolved when resolving request
|
protected void |
resolveRequest(MetaData metaData,
IndexMetaData indexMetaData,
Request request)
Resolves derived values in the request.
|
protected boolean |
retryPrimaryException(java.lang.Throwable e) |
protected abstract TransportReplicationAction.PrimaryResult<ReplicaRequest,Response> |
shardOperationOnPrimary(Request shardRequest,
IndexShard primary)
Primary operation on node with primary copy.
|
protected abstract TransportReplicationAction.ReplicaResult |
shardOperationOnReplica(ReplicaRequest shardRequest,
IndexShard replica)
Synchronous replica operation on nodes with replica copies.
|
protected boolean |
shouldExecuteReplication(IndexMetaData indexMetaData)
Indicated whether this operation should be replicated to shadow replicas or not.
|
protected TransportRequestOptions |
transportOptions() |
execute, execute, execute, execute
logDeprecatedSetting, logRemovedSetting, nodeName
protected final ClusterService clusterService
protected TransportReplicationAction(Settings settings, java.lang.String actionName, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, java.util.function.Supplier<Request> request, java.util.function.Supplier<ReplicaRequest> replicaRequest, java.lang.String executor)
protected final void doExecute(Request request, ActionListener<Response> listener)
doExecute
in class TransportAction<Request extends ReplicationRequest<Request>,Response extends ReplicationResponse>
protected void doExecute(Task task, Request request, ActionListener<Response> listener)
doExecute
in class TransportAction<Request extends ReplicationRequest<Request>,Response extends ReplicationResponse>
protected abstract Response newResponseInstance()
protected void resolveRequest(MetaData metaData, IndexMetaData indexMetaData, Request request)
metaData
- cluster state metadataindexMetaData
- index metadata of the concrete index this request is going to operate onrequest
- the request to resolveprotected abstract TransportReplicationAction.PrimaryResult<ReplicaRequest,Response> shardOperationOnPrimary(Request shardRequest, IndexShard primary) throws java.lang.Exception
shardRequest
- the request to the primary shardprimary
- the primary shard to perform the operation onjava.lang.Exception
protected abstract TransportReplicationAction.ReplicaResult shardOperationOnReplica(ReplicaRequest shardRequest, IndexShard replica) throws java.lang.Exception
IndexShard.acquireReplicaOperationLock(long, ActionListener, String)
shardRequest
- the request to the replica shardreplica
- the replica shard to perform the operation onjava.lang.Exception
@Nullable protected ClusterBlockLevel globalBlockLevel()
@Nullable protected ClusterBlockLevel indexBlockLevel()
protected boolean resolveIndex()
protected TransportRequestOptions transportOptions()
protected boolean retryPrimaryException(java.lang.Throwable e)
protected boolean shouldExecuteReplication(IndexMetaData indexMetaData)