public abstract class TransportReplicationAction<Request extends ReplicationRequest<Request>,ReplicaRequest extends ReplicationRequest<ReplicaRequest>,Response extends ReplicationResponse> extends TransportAction<Request,Response>
Modifier and Type | Field and Description |
---|---|
protected ClusterService |
clusterService |
protected java.lang.String |
executor |
protected IndicesService |
indicesService |
protected ShardStateAction |
shardStateAction |
protected TransportRequestOptions |
transportOptions |
protected java.lang.String |
transportPrimaryAction |
protected java.lang.String |
transportReplicaAction |
protected TransportService |
transportService |
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) |
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,
boolean syncGlobalCheckpointAfterOperation) |
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 IndexShard |
getIndexShard(ShardId shardId) |
protected ClusterBlockLevel |
globalBlockLevel()
Cluster level block to check before request execution.
|
protected ClusterBlockLevel |
indexBlockLevel()
Index level block to check before request execution.
|
protected ReplicationOperation.Replicas<ReplicaRequest> |
newReplicasProxy(long primaryTerm) |
protected abstract Response |
newResponseInstance() |
protected void |
registerRequestHandlers(java.lang.String actionName,
TransportService transportService,
java.util.function.Supplier<Request> request,
java.util.function.Supplier<ReplicaRequest> replicaRequest,
java.lang.String executor) |
protected boolean |
resolveIndex()
True if provided index should be resolved when resolving request
|
protected void |
resolveRequest(IndexMetaData indexMetaData,
Request request)
Resolves derived values in the request.
|
protected boolean |
retryPrimaryException(java.lang.Throwable e) |
protected void |
sendReplicaRequest(TransportReplicationAction.ConcreteReplicaRequest<ReplicaRequest> replicaRequest,
DiscoveryNode node,
ActionListener<ReplicationOperation.ReplicaResponse> listener)
Sends the specified replica request to the specified node.
|
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)
Synchronously execute the specified replica operation.
|
protected TransportRequestOptions |
transportOptions() |
execute, execute, execute, execute
logDeprecatedSetting, logRemovedSetting, nodeName
protected final TransportService transportService
protected final ClusterService clusterService
protected final ShardStateAction shardStateAction
protected final IndicesService indicesService
protected final TransportRequestOptions transportOptions
protected final java.lang.String executor
protected final java.lang.String transportReplicaAction
protected final java.lang.String transportPrimaryAction
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 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, boolean syncGlobalCheckpointAfterOperation)
protected void registerRequestHandlers(java.lang.String actionName, TransportService transportService, 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 ReplicationOperation.Replicas<ReplicaRequest> newReplicasProxy(long primaryTerm)
protected abstract Response newResponseInstance()
protected void resolveRequest(IndexMetaData indexMetaData, Request request)
indexMetaData
- 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.acquireReplicaOperationPermit(long, 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 IndexShard getIndexShard(ShardId shardId)
protected void sendReplicaRequest(TransportReplicationAction.ConcreteReplicaRequest<ReplicaRequest> replicaRequest, DiscoveryNode node, ActionListener<ReplicationOperation.ReplicaResponse> listener)
replicaRequest
- the replica requestnode
- the node to send the request tolistener
- callback for handling the response or failure