public class TransportIndexAction extends TransportWriteAction<IndexRequest,IndexResponse>
TransportWriteAction.WriteResult<Response extends ReplicationResponse>
TransportReplicationAction.ConcreteShardRequest<R extends TransportRequest>, TransportReplicationAction.PrimaryResult, TransportReplicationAction.ReplicaResult, TransportReplicationAction.RetryOnReplicaException
indicesService, 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 TransportWriteAction.WriteResult<IndexResponse> |
executeIndexRequestOnPrimary(IndexRequest request,
IndexShard indexShard,
MappingUpdatedAction mappingUpdatedAction) |
static Engine.Index |
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() |
protected TransportWriteAction.WriteResult<IndexResponse> |
onPrimaryShard(IndexRequest request,
IndexShard indexShard)
Called on the primary with a reference to the IndexShard to modify.
|
protected Translog.Location |
onReplicaShard(IndexRequest request,
IndexShard indexShard)
Called once per replica with a reference to the IndexShard to modify.
|
static Engine.Index |
prepareIndexOperationOnPrimary(IndexRequest request,
IndexShard indexShard)
Utility method to prepare an index operation on primary shards
|
protected void |
resolveRequest(MetaData metaData,
IndexMetaData indexMetaData,
IndexRequest request)
Resolves derived values in the request.
|
indexShard, shardOperationOnPrimary, shardOperationOnReplica
acquirePrimaryShardReference, acquireReplicaOperationLock, doExecute, globalBlockLevel, indexBlockLevel, 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, IndexMetaData indexMetaData, IndexRequest request)
TransportReplicationAction
resolveRequest
in class TransportReplicationAction<IndexRequest,IndexRequest,IndexResponse>
metaData
- cluster state metadataindexMetaData
- index metadata of the concrete index this request is going to operate onrequest
- the request to resolveprotected IndexResponse newResponseInstance()
newResponseInstance
in class TransportReplicationAction<IndexRequest,IndexRequest,IndexResponse>
protected TransportWriteAction.WriteResult<IndexResponse> onPrimaryShard(IndexRequest request, IndexShard indexShard) throws java.lang.Exception
TransportWriteAction
onPrimaryShard
in class TransportWriteAction<IndexRequest,IndexResponse>
java.lang.Exception
protected Translog.Location onReplicaShard(IndexRequest request, IndexShard indexShard)
TransportWriteAction
onReplicaShard
in class TransportWriteAction<IndexRequest,IndexResponse>
public static Engine.Index executeIndexRequestOnReplica(IndexRequest request, IndexShard indexShard)
IndexRequest
on a replica shard, throwing a
RetryOnReplicaException
if the operation needs to be re-tried.public static Engine.Index prepareIndexOperationOnPrimary(IndexRequest request, IndexShard indexShard)
public static TransportWriteAction.WriteResult<IndexResponse> executeIndexRequestOnPrimary(IndexRequest request, IndexShard indexShard, MappingUpdatedAction mappingUpdatedAction) throws java.lang.Exception
java.lang.Exception