public abstract class TransportReplicationAction<Request extends ReplicationRequest,ReplicaRequest extends ReplicationRequest,Response extends ActionWriteResponse> extends TransportAction<Request,Response>
Modifier and Type | Class and Description |
---|---|
static class |
TransportReplicationAction.RetryOnPrimaryException |
static class |
TransportReplicationAction.RetryOnReplicaException |
protected static class |
TransportReplicationAction.WriteResult<T extends ActionWriteResponse> |
Modifier and Type | Field and Description |
---|---|
protected ClusterService |
clusterService |
protected WriteConsistencyLevel |
defaultWriteConsistencyLevel |
protected IndicesService |
indicesService |
protected MappingUpdatedAction |
mappingUpdatedAction |
protected ShardStateAction |
shardStateAction |
protected TransportRequestOptions |
transportOptions |
protected TransportService |
transportService |
actionName, indexNameExpressionResolver, parseFieldMatcher, taskManager, threadPool
deprecationLogger, logger, settings
Modifier | Constructor and Description |
---|---|
protected |
TransportReplicationAction(Settings settings,
String actionName,
TransportService transportService,
ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ShardStateAction shardStateAction,
MappingUpdatedAction mappingUpdatedAction,
ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver,
Class<Request> request,
Class<ReplicaRequest> replicaRequest,
String executor) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkWriteConsistency()
True if write consistency should be checked for an implementation
|
protected void |
doExecute(Request request,
ActionListener<Response> listener) |
protected void |
doExecute(Task task,
Request request,
ActionListener<Response> listener) |
protected Releasable |
getIndexShardOperationsCounter(ShardId shardId) |
protected ClusterBlockLevel |
globalBlockLevel()
Cluster level block to check before request execution
|
protected boolean |
ignoreReplicaException(Throwable e)
Should an exception be ignored when the operation is performed on the replica.
|
protected ClusterBlockLevel |
indexBlockLevel()
Index level block to check before request execution
|
protected boolean |
isConflictException(Throwable e) |
protected abstract Response |
newResponseInstance() |
protected void |
processAfterWrite(boolean refresh,
IndexShard indexShard,
Translog.Location location) |
protected boolean |
resolveIndex()
True if provided index should be resolved when resolving request
|
protected void |
resolveRequest(MetaData metaData,
String concreteIndex,
Request request)
Resolves the target shard id of the incoming request.
|
protected boolean |
retryPrimaryException(Throwable e) |
protected abstract Tuple<Response,ReplicaRequest> |
shardOperationOnPrimary(MetaData metaData,
Request shardRequest)
Primary operation on node with primary copy, the provided metadata should be used for request validation if needed
|
protected abstract void |
shardOperationOnReplica(ReplicaRequest shardRequest)
Replica operation on nodes with replica copies
|
protected boolean |
shouldExecuteReplication(Settings settings)
Indicated whether this operation should be replicated to shadow replicas or not.
|
protected TransportRequestOptions |
transportOptions() |
execute, execute, execute, execute
logDeprecatedSetting, logRemovedSetting, nodeName
protected final TransportService transportService
protected final ClusterService clusterService
protected final IndicesService indicesService
protected final ShardStateAction shardStateAction
protected final WriteConsistencyLevel defaultWriteConsistencyLevel
protected final TransportRequestOptions transportOptions
protected final MappingUpdatedAction mappingUpdatedAction
protected TransportReplicationAction(Settings settings, String actionName, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, MappingUpdatedAction mappingUpdatedAction, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Class<Request> request, Class<ReplicaRequest> replicaRequest, String executor)
protected final void doExecute(Request request, ActionListener<Response> listener)
doExecute
in class TransportAction<Request extends ReplicationRequest,Response extends ActionWriteResponse>
protected void doExecute(Task task, Request request, ActionListener<Response> listener)
doExecute
in class TransportAction<Request extends ReplicationRequest,Response extends ActionWriteResponse>
protected abstract Response newResponseInstance()
protected void resolveRequest(MetaData metaData, String concreteIndex, Request request)
protected abstract Tuple<Response,ReplicaRequest> shardOperationOnPrimary(MetaData metaData, Request shardRequest) throws Throwable
Throwable
protected abstract void shardOperationOnReplica(ReplicaRequest shardRequest)
protected boolean checkWriteConsistency()
protected ClusterBlockLevel globalBlockLevel()
protected ClusterBlockLevel indexBlockLevel()
protected boolean resolveIndex()
protected TransportRequestOptions transportOptions()
protected boolean retryPrimaryException(Throwable e)
protected boolean ignoreReplicaException(Throwable e)
protected boolean isConflictException(Throwable e)
protected Releasable getIndexShardOperationsCounter(ShardId shardId)
protected boolean shouldExecuteReplication(Settings settings)
protected final void processAfterWrite(boolean refresh, IndexShard indexShard, Translog.Location location)
Copyright © 2009–2016. All rights reserved.