Class BulkProcessor.Builder

  • Enclosing class:
    BulkProcessor

    public static class BulkProcessor.Builder
    extends java.lang.Object
    A builder used to create a build an instance of a bulk processor.
    • Method Detail

      • setConcurrentRequests

        public BulkProcessor.Builder setConcurrentRequests​(int concurrentRequests)
        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 to 1.
      • setBulkActions

        public BulkProcessor.Builder setBulkActions​(int bulkActions)
        Sets when to flush a new bulk request based on the number of actions currently added. Defaults to 1000. Can be set to -1 to disable it.
      • setBulkSize

        public BulkProcessor.Builder setBulkSize​(ByteSizeValue bulkSize)
        Sets when to flush a new bulk request based on the size of actions currently added. Defaults to 5mb. Can be set to -1 to disable it.
      • setGlobalPipeline

        public BulkProcessor.Builder setGlobalPipeline​(java.lang.String globalPipeline)
      • setBackoffPolicy

        public BulkProcessor.Builder setBackoffPolicy​(BackoffPolicy backoffPolicy)
        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:
        BackoffPolicy.exponentialBackoff()
      • build

        public BulkProcessor build()
        Builds a new bulk processor.