java.lang.Object
org.elasticsearch.action.support.TransportAction<BulkRequest,BulkResponse>
org.elasticsearch.action.support.HandledTransportAction<BulkRequest,BulkResponse>
org.elasticsearch.action.bulk.TransportAbstractBulkAction
org.elasticsearch.action.bulk.TransportBulkAction
Groups bulk request items by shard, optionally creating non-existent indices and
delegates to
TransportShardBulkAction for shard-level bulk execution-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final ActionType<BulkResponse> Fields inherited from class org.elasticsearch.action.bulk.TransportAbstractBulkAction
clusterService, coordinationExecutor, indexingPressure, projectResolver, relativeTimeNanosProvider, systemIndices, systemWriteExecutor, threadPool, writeExecutorFields inherited from class org.elasticsearch.action.support.TransportAction
actionName, taskManager -
Constructor Summary
ConstructorsConstructorDescriptionTransportBulkAction(ThreadPool threadPool, TransportService transportService, ClusterService clusterService, IngestService ingestService, NodeClient client, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, IndexingPressure indexingPressure, SystemIndices systemIndices, ProjectResolver projectResolver, LongSupplier relativeTimeProvider, FailureStoreMetrics failureStoreMetrics, DataStreamFailureStoreSettings dataStreamFailureStoreSettings, FeatureService featureService) TransportBulkAction(ThreadPool threadPool, TransportService transportService, ClusterService clusterService, IngestService ingestService, NodeClient client, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, IndexingPressure indexingPressure, SystemIndices systemIndices, ProjectResolver projectResolver, FailureStoreMetrics failureStoreMetrics, DataStreamFailureStoreSettings dataStreamFailureStoreSettings, FeatureService featureService) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateMissingIndicesAndIndexData(Task task, BulkRequest bulkRequest, Executor executor, ActionListener<BulkResponse> listener, Map<String, CreateIndexRequest> indicesToAutoCreate, Set<String> dataStreamsToBeRolledOver, Set<String> failureStoresToBeRolledOver, long startTimeNanos) This method is responsible for creating any missing indices, rolling over data streams and their failure stores when needed, and then indexing the data in the BulkRequest.protected voiddoInternalExecute(Task task, BulkRequest bulkRequest, Executor executor, ActionListener<BulkResponse> listener, long relativeStartTimeNanos) This method creates any missing resources and actually applies the BulkRequest to the relevant indicesprotected BooleanresolveFailureStore(String indexName, ProjectMetadata metadata, long time) Determines if an index name is associated with either an existing data stream or a template for one that has the failure store enabled.static <Response extends ReplicationResponse & WriteResponse>
ActionListener<BulkResponse> unwrappingSingleItemBulkResponse(ActionListener<Response> listener) Methods inherited from class org.elasticsearch.action.bulk.TransportAbstractBulkAction
buildTookInMillis, doExecute, getIndexWriteRequest, getIngestService, relativeTimeNanosMethods inherited from class org.elasticsearch.action.support.TransportAction
execute, executeDirect, localOnly
-
Field Details
-
NAME
- See Also:
-
TYPE
-
LAZY_ROLLOVER_ORIGIN
- See Also:
-
-
Constructor Details
-
TransportBulkAction
@Inject public TransportBulkAction(ThreadPool threadPool, TransportService transportService, ClusterService clusterService, IngestService ingestService, NodeClient client, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, IndexingPressure indexingPressure, SystemIndices systemIndices, ProjectResolver projectResolver, FailureStoreMetrics failureStoreMetrics, DataStreamFailureStoreSettings dataStreamFailureStoreSettings, FeatureService featureService) -
TransportBulkAction
public TransportBulkAction(ThreadPool threadPool, TransportService transportService, ClusterService clusterService, IngestService ingestService, NodeClient client, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, IndexingPressure indexingPressure, SystemIndices systemIndices, ProjectResolver projectResolver, LongSupplier relativeTimeProvider, FailureStoreMetrics failureStoreMetrics, DataStreamFailureStoreSettings dataStreamFailureStoreSettings, FeatureService featureService)
-
-
Method Details
-
unwrappingSingleItemBulkResponse
public static <Response extends ReplicationResponse & WriteResponse> ActionListener<BulkResponse> unwrappingSingleItemBulkResponse(ActionListener<Response> listener) -
doInternalExecute
protected void doInternalExecute(Task task, BulkRequest bulkRequest, Executor executor, ActionListener<BulkResponse> listener, long relativeStartTimeNanos) throws IOException Description copied from class:TransportAbstractBulkActionThis method creates any missing resources and actually applies the BulkRequest to the relevant indices- Specified by:
doInternalExecutein classTransportAbstractBulkAction- Parameters:
task- The task in which this work is being donebulkRequest- The BulkRequest of changes to make to indicesexecutor- The executor for the thread pool in which the work is to be donelistener- The listener to be notified of resultsrelativeStartTimeNanos- The relative start time of this bulk load, to be used in computing the time taken for the BulkResponse- Throws:
IOException
-
createMissingIndicesAndIndexData
protected void createMissingIndicesAndIndexData(Task task, BulkRequest bulkRequest, Executor executor, ActionListener<BulkResponse> listener, Map<String, CreateIndexRequest> indicesToAutoCreate, Set<String> dataStreamsToBeRolledOver, Set<String> failureStoresToBeRolledOver, long startTimeNanos) This method is responsible for creating any missing indices, rolling over data streams and their failure stores when needed, and then indexing the data in the BulkRequest. -
resolveFailureStore
Description copied from class:TransportAbstractBulkActionDetermines if an index name is associated with either an existing data stream or a template for one that has the failure store enabled.- Specified by:
resolveFailureStorein classTransportAbstractBulkAction- Parameters:
indexName- The index name to check.metadata- Cluster state metadata.time- A timestamp to use when resolving date math in the index name.- Returns:
- true if this is not a simulation, and the given index name corresponds to a data stream with a failure store, or if it matches a template that has a data stream failure store enabled, or if it matches a data stream template with no failure store option specified and the name matches the cluster setting to enable the failure store. Returns false if the index name corresponds to a data stream, but it doesn't have the failure store enabled by one of those conditions. Returns null when it doesn't correspond to a data stream.
-