Package org.elasticsearch.action.bulk
Class TransportShardBulkAction
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.action.support.TransportAction<Request,Response>
-
- org.elasticsearch.action.support.replication.TransportReplicationAction<Request,ReplicaRequest,Response>
-
- org.elasticsearch.action.support.replication.TransportWriteAction<BulkShardRequest,BulkShardRequest,BulkShardResponse>
-
- org.elasticsearch.action.bulk.TransportShardBulkAction
-
public class TransportShardBulkAction extends TransportWriteAction<BulkShardRequest,BulkShardRequest,BulkShardResponse>
Performs shard-level bulk (index, delete or update) operations
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TransportShardBulkAction.ReplicaItemExecutionMode
Modes for executing item request on replica depending on corresponding primary execution result-
Nested classes/interfaces inherited from class org.elasticsearch.action.support.replication.TransportWriteAction
TransportWriteAction.WritePrimaryResult<ReplicaRequest extends ReplicatedWriteRequest<ReplicaRequest>,Response extends ReplicationResponse & WriteResponse>, TransportWriteAction.WriteReplicaResult<ReplicaRequest extends ReplicatedWriteRequest<ReplicaRequest>>
-
Nested classes/interfaces inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
TransportReplicationAction.ConcreteReplicaRequest<R extends TransportRequest>, TransportReplicationAction.ConcreteShardRequest<R extends TransportRequest>, TransportReplicationAction.OperationTransportHandler, TransportReplicationAction.PrimaryOperationTransportHandler, TransportReplicationAction.PrimaryResult<ReplicaRequest extends ReplicationRequest<ReplicaRequest>,Response extends ReplicationResponse>, TransportReplicationAction.ReplicaOperationTransportHandler, TransportReplicationAction.ReplicaResponse, TransportReplicationAction.ReplicaResult, TransportReplicationAction.ReplicasProxy, TransportReplicationAction.RetryOnReplicaException
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACTION_NAME
-
Fields inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
clusterService, executor, indicesService, shardStateAction, transportOptions, transportPrimaryAction, transportReplicaAction, transportService
-
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, indexNameExpressionResolver, taskManager, threadPool
-
-
Constructor Summary
Constructors Constructor Description TransportShardBulkAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, MappingUpdatedAction mappingUpdatedAction, UpdateHelper updateHelper, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
Method Summary
Modifier and Type Method Description protected BulkShardResponse
newResponseInstance()
static TransportWriteAction.WritePrimaryResult<BulkShardRequest,BulkShardResponse>
performOnPrimary(BulkShardRequest request, IndexShard primary, UpdateHelper updateHelper, boolean canUseIfSeqNo, java.util.function.LongSupplier nowInMillisSupplier, MappingUpdatePerformer mappingUpdater, CheckedRunnable<java.lang.Exception> waitForMappingUpdate)
static Translog.Location
performOnReplica(BulkShardRequest request, IndexShard replica)
protected boolean
resolveIndex()
True if provided index should be resolved when resolving requestprotected TransportWriteAction.WritePrimaryResult<BulkShardRequest,BulkShardResponse>
shardOperationOnPrimary(BulkShardRequest request, IndexShard primary)
Called on the primary with a reference to the primary IndexShard to modify.TransportWriteAction.WriteReplicaResult<BulkShardRequest>
shardOperationOnReplica(BulkShardRequest request, IndexShard replica)
Called once per replica with a reference to the replica IndexShard to modify.protected TransportRequestOptions
transportOptions(Settings settings)
-
Methods inherited from class org.elasticsearch.action.support.replication.TransportWriteAction
globalBlockLevel, indexBlockLevel, locationToSync, newReplicasProxy, syncOperationResultOrThrow
-
Methods inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
acquirePrimaryOperationPermit, acquireReplicaOperationPermit, doExecute, doExecute, getIndexShard, registerRequestHandlers, resolveRequest, retryPrimaryException, sendReplicaRequest
-
Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute, execute
-
-
-
-
Field Detail
-
ACTION_NAME
public static final java.lang.String ACTION_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TransportShardBulkAction
@Inject public TransportShardBulkAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, MappingUpdatedAction mappingUpdatedAction, UpdateHelper updateHelper, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
-
Method Detail
-
transportOptions
protected TransportRequestOptions transportOptions(Settings settings)
- Overrides:
transportOptions
in classTransportReplicationAction<BulkShardRequest,BulkShardRequest,BulkShardResponse>
-
newResponseInstance
protected BulkShardResponse newResponseInstance()
- Specified by:
newResponseInstance
in classTransportReplicationAction<BulkShardRequest,BulkShardRequest,BulkShardResponse>
-
resolveIndex
protected boolean resolveIndex()
Description copied from class:TransportReplicationAction
True if provided index should be resolved when resolving request- Overrides:
resolveIndex
in classTransportReplicationAction<BulkShardRequest,BulkShardRequest,BulkShardResponse>
-
shardOperationOnPrimary
protected TransportWriteAction.WritePrimaryResult<BulkShardRequest,BulkShardResponse> shardOperationOnPrimary(BulkShardRequest request, IndexShard primary) throws java.lang.Exception
Description copied from class:TransportWriteAction
Called on the primary with a reference to the primary IndexShard to modify.- Specified by:
shardOperationOnPrimary
in classTransportWriteAction<BulkShardRequest,BulkShardRequest,BulkShardResponse>
- Parameters:
request
- the request to the primary shardprimary
- the primary shard to perform the operation on- Returns:
- the result of the operation on primary, including current translog location and operation response and failure
async refresh is performed on the
primary
shard according to theRequest
refresh policy - Throws:
java.lang.Exception
-
performOnPrimary
public static TransportWriteAction.WritePrimaryResult<BulkShardRequest,BulkShardResponse> performOnPrimary(BulkShardRequest request, IndexShard primary, UpdateHelper updateHelper, boolean canUseIfSeqNo, java.util.function.LongSupplier nowInMillisSupplier, MappingUpdatePerformer mappingUpdater, CheckedRunnable<java.lang.Exception> waitForMappingUpdate) throws java.lang.Exception
- Throws:
java.lang.Exception
-
shardOperationOnReplica
public TransportWriteAction.WriteReplicaResult<BulkShardRequest> shardOperationOnReplica(BulkShardRequest request, IndexShard replica) throws java.lang.Exception
Description copied from class:TransportWriteAction
Called once per replica with a reference to the replica IndexShard to modify.- Specified by:
shardOperationOnReplica
in classTransportWriteAction<BulkShardRequest,BulkShardRequest,BulkShardResponse>
- Parameters:
request
- the request to the replica shardreplica
- the replica shard to perform the operation on- Returns:
- the result of the operation on replica, including current translog location and operation response and failure
async refresh is performed on the
replica
shard according to theReplicaRequest
refresh policy - Throws:
java.lang.Exception
-
performOnReplica
public static Translog.Location performOnReplica(BulkShardRequest request, IndexShard replica) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-