public class BatchPolicy extends Object

Policy for flushing batched requests.

The trigger for uploading a batch of requests is by either the number of requests or the timeout, whichever comes first. For example, if the batch delay time has expired without the batch size being reached, or if the batch size number of documents is reached before the delay time expires, then the batch upload is triggered.

Nested Class Summary

class BatchPolicy.Builder  

Public Method Summary

static BatchPolicy
Creates a batch policy from configuration file parameters.

Inherited Method Summary

Public Methods

public static BatchPolicy fromConfiguration ()

Creates a batch policy from configuration file parameters.

The configuration file should have parameters in the format of:

  • batch.flushOnShutdown = true to flush batched request during service shutdown
  • batch.batchSize = 10 number of requests to batch together
  • batch.maxBatchDelaySeconds = 5 number of seconds to wait before batched requests are flushed automatically
  • batch.maxQueueLength = 1000 maximum number of requests in batch queue for execution
  • batch.maxActiveBatches = 20 number of allowable concurrently executing batches
  • batch.readTimeoutSeconds = 120 read timeout in seconds for batch request
  • batch.connectTimeoutSeconds = 120 connect timeout in seconds for batch request

public int getBatchConnectTimeoutSeconds ()

public int getBatchReadTimeoutSeconds ()

public int getMaxActiveBatches ()

public int getMaxBatchDelay ()

public TimeUnit getMaxBatchDelayUnit ()

public int getMaxBatchSize ()

public int getQueueLength ()

public boolean isFlushOnShutdown ()

Send feedback about...

Cloud Search
Cloud Search