Package org.elasticsearch.action.bulk
Class BulkProcessor2.Builder
java.lang.Object
org.elasticsearch.action.bulk.BulkProcessor2.Builder
- Enclosing class:
- BulkProcessor2
A builder used to create a build an instance of a bulk processor.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a new bulk processor.setBulkActions
(int bulkActions) Sets when to flush a new bulk request based on the number of actions currently added.setBulkSize
(ByteSizeValue maxBulkSizeInBytes) Sets when to flush a new bulk request based on the size of actions currently added.setFlushInterval
(TimeValue flushInterval) Sets a flush interval flushing *any* bulk actions pending if the interval passes.setMaxBytesInFlight
(ByteSizeValue maxBytesInFlight) Sets the maximum number of bytes allowed in in-flight requests (both the BulkRequest being built up by the BulkProcessor and any BulkRequests sent to Retry2 that have not yet completed) before subsequent calls to add()result in EsRejectedExecutionException.setMaxNumberOfRetries
(int maxNumberOfRetries) Sets the maximum number of times a BulkRequest will be retried if it fails.
-
Method Details
-
setBulkActions
Sets when to flush a new bulk request based on the number of actions currently added. Defaults to1000
. Can be set to-1
to disable it. -
setBulkSize
Sets when to flush a new bulk request based on the size of actions currently added. Defaults to5mb
. Can be set to-1
to disable it. -
setFlushInterval
Sets a flush interval flushing *any* bulk actions pending if the interval passes. Defaults to not set.Note, both
setBulkActions(int)
andsetBulkSize(org.elasticsearch.common.unit.ByteSizeValue)
can be set to-1
with the flush interval set allowing for complete async processing of bulk actions. -
setMaxNumberOfRetries
Sets the maximum number of times a BulkRequest will be retried if it fails. -
setMaxBytesInFlight
Sets the maximum number of bytes allowed in in-flight requests (both the BulkRequest being built up by the BulkProcessor and any BulkRequests sent to Retry2 that have not yet completed) before subsequent calls to add()result in EsRejectedExecutionException. Defaults to 50mb. -
build
Builds a new bulk processor.
-