public class TransportIndexAction extends TransportReplicationAction<IndexRequest,IndexRequest,IndexResponse>
Allows for the following settings:
TransportReplicationAction.RetryOnPrimaryException, TransportReplicationAction.RetryOnReplicaException, TransportReplicationAction.WriteResult<T extends ActionWriteResponse>
defaultWriteConsistencyLevel, indicesService, mappingUpdatedAction, shardStateAction, transportOptions, transportService
actionName, indexNameExpressionResolver, parseFieldMatcher, taskManager, threadPool
deprecationLogger, logger, settings
Constructor and Description |
---|
TransportIndexAction(Settings settings,
TransportService transportService,
ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ShardStateAction shardStateAction,
TransportCreateIndexAction createIndexAction,
MappingUpdatedAction mappingUpdatedAction,
ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver,
AutoCreateIndex autoCreateIndex) |
Modifier and Type | Method and Description |
---|---|
protected void |
doExecute(Task task,
IndexRequest request,
ActionListener<IndexResponse> listener) |
static TransportReplicationAction.WriteResult<IndexResponse> |
executeIndexRequestOnPrimary(BulkShardRequest shardRequest,
IndexRequest request,
IndexShard indexShard,
MappingUpdatedAction mappingUpdatedAction)
Execute the given
IndexRequest on a primary shard, throwing a
RetryOnPrimaryException if the operation needs to be re-tried. |
static Engine.IndexingOperation |
executeIndexRequestOnReplica(IndexRequest request,
IndexShard indexShard)
Execute the given
IndexRequest on a replica shard, throwing a
RetryOnReplicaException if the operation needs to be re-tried. |
protected IndexResponse |
newResponseInstance() |
static Engine.IndexingOperation |
prepareIndexOperationOnPrimary(BulkShardRequest shardRequest,
IndexRequest request,
IndexShard indexShard)
Utility method to create either an index or a create operation depending
on the
IndexRequest.OpType of the request. |
protected void |
resolveRequest(MetaData metaData,
String concreteIndex,
IndexRequest request)
Resolves the target shard id of the incoming request.
|
protected Tuple<IndexResponse,IndexRequest> |
shardOperationOnPrimary(MetaData metaData,
IndexRequest request)
Primary operation on node with primary copy, the provided metadata should be used for request validation if needed
|
protected void |
shardOperationOnReplica(IndexRequest request)
Replica operation on nodes with replica copies
|
checkWriteConsistency, doExecute, getIndexShardOperationsCounter, globalBlockLevel, ignoreReplicaException, indexBlockLevel, isConflictException, processAfterWrite, resolveIndex, retryPrimaryException, shouldExecuteReplication, transportOptions
execute, execute, execute, execute
logDeprecatedSetting, logRemovedSetting, nodeName
@Inject public TransportIndexAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, TransportCreateIndexAction createIndexAction, MappingUpdatedAction mappingUpdatedAction, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, AutoCreateIndex autoCreateIndex)
protected void doExecute(Task task, IndexRequest request, ActionListener<IndexResponse> listener)
doExecute
in class TransportReplicationAction<IndexRequest,IndexRequest,IndexResponse>
protected void resolveRequest(MetaData metaData, String concreteIndex, IndexRequest request)
TransportReplicationAction
resolveRequest
in class TransportReplicationAction<IndexRequest,IndexRequest,IndexResponse>
protected IndexResponse newResponseInstance()
newResponseInstance
in class TransportReplicationAction<IndexRequest,IndexRequest,IndexResponse>
protected Tuple<IndexResponse,IndexRequest> shardOperationOnPrimary(MetaData metaData, IndexRequest request) throws Throwable
TransportReplicationAction
shardOperationOnPrimary
in class TransportReplicationAction<IndexRequest,IndexRequest,IndexResponse>
Throwable
protected void shardOperationOnReplica(IndexRequest request)
TransportReplicationAction
shardOperationOnReplica
in class TransportReplicationAction<IndexRequest,IndexRequest,IndexResponse>
public static Engine.IndexingOperation executeIndexRequestOnReplica(IndexRequest request, IndexShard indexShard)
IndexRequest
on a replica shard, throwing a
RetryOnReplicaException
if the operation needs to be re-tried.public static Engine.IndexingOperation prepareIndexOperationOnPrimary(BulkShardRequest shardRequest, IndexRequest request, IndexShard indexShard)
IndexRequest.OpType
of the request.public static TransportReplicationAction.WriteResult<IndexResponse> executeIndexRequestOnPrimary(BulkShardRequest shardRequest, IndexRequest request, IndexShard indexShard, MappingUpdatedAction mappingUpdatedAction) throws Throwable
IndexRequest
on a primary shard, throwing a
RetryOnPrimaryException
if the operation needs to be re-tried.Throwable
Copyright © 2009–2016. All rights reserved.