Package org.elasticsearch.action.bulk
Class BulkProcessor.Builder
java.lang.Object
org.elasticsearch.action.bulk.BulkProcessor.Builder
- Enclosing class:
- BulkProcessor
A builder used to create a build an instance of a bulk processor.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a new bulk processor.setBackoffPolicy
(BackoffPolicy backoffPolicy) Sets a custom backoff policy.setBulkActions
(int bulkActions) Sets when to flush a new bulk request based on the number of actions currently added.setBulkSize
(ByteSizeValue bulkSize) Sets when to flush a new bulk request based on the size of actions currently added.setConcurrentRequests
(int concurrentRequests) Sets the number of concurrent requests allowed to be executed.setFlushCondition
(Supplier<Boolean> flushCondition) setFlushInterval
(TimeValue flushInterval) Sets a flush interval flushing *any* bulk actions pending if the interval passes.setGlobalIndex
(String globalIndex) setGlobalPipeline
(String globalPipeline) setGlobalRouting
(String globalRouting) setGlobalType
(String globalType)
-
Method Details
-
setConcurrentRequests
Sets the number of concurrent requests allowed to be executed. A value of 0 means that only a single request will be allowed to be executed. A value of 1 means 1 concurrent request is allowed to be executed while accumulating new bulk requests. Defaults to1
. -
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. -
setGlobalIndex
-
setGlobalType
-
setGlobalRouting
-
setGlobalPipeline
-
setBackoffPolicy
Sets a custom backoff policy. The backoff policy defines how the bulk processor should handle retries of bulk requests internally in case they have failed due to resource constraints (i.e. a thread pool was full). The default is to back off exponentially.- See Also:
-
build
Builds a new bulk processor. -
setFlushCondition
-