Class Batcher.Options
- java.lang.Object
-
- com.salesforce.multicloudj.pubsub.batcher.Batcher.Options
-
public static class Batcher.Options extends Object
Configuration options that govern how theBatcherbehaves. All limits are inclusive and validated by theBatcherwhere relevant. maxHandlers - Maximum number of concurrent handler threads that may be actively processing batches at any given time. Must be >= 1 and determines the size of the underlying executor. minBatchSize - Minimum number of items required before a batch is dispatched during normal operation. If fewer than this number are pending, the batcher waits for more items unless it is shutting down (in which case remaining items are flushed regardless). maxBatchSize - Hard cap on the number of items allowed in a single batch. A value of 0 disables this bound. When both maxBatchSize and maxBatchByteSize are set, whichever limit is reached first finalises the batch. maxBatchByteSize - Hard cap on the cumulative byte size of the items in a single batch, as reported byBatcher.SizableItem.getByteSize(). A value of 0 disables this bound.
-
-
Constructor Summary
Constructors Constructor Description Options()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMaxBatchByteSize()Maximum total byte size of a batch (0 = unlimited)intgetMaxBatchSize()Maximum number of items in a single batch (0 = unlimited)intgetMaxHandlers()Maximum number of concurrent handler threadsintgetMinBatchSize()Minimum number of items required to form a batchBatcher.OptionssetMaxBatchByteSize(int maxBatchByteSize)Maximum total byte size of a batch (0 = unlimited)Batcher.OptionssetMaxBatchSize(int maxBatchSize)Maximum number of items in a single batch (0 = unlimited)Batcher.OptionssetMaxHandlers(int maxHandlers)Maximum number of concurrent handler threadsBatcher.OptionssetMinBatchSize(int minBatchSize)Minimum number of items required to form a batch
-
-
-
Method Detail
-
getMaxHandlers
public int getMaxHandlers()
Maximum number of concurrent handler threads
-
getMinBatchSize
public int getMinBatchSize()
Minimum number of items required to form a batch
-
getMaxBatchSize
public int getMaxBatchSize()
Maximum number of items in a single batch (0 = unlimited)
-
getMaxBatchByteSize
public int getMaxBatchByteSize()
Maximum total byte size of a batch (0 = unlimited)
-
setMaxHandlers
public Batcher.Options setMaxHandlers(int maxHandlers)
Maximum number of concurrent handler threads- Returns:
this.
-
setMinBatchSize
public Batcher.Options setMinBatchSize(int minBatchSize)
Minimum number of items required to form a batch- Returns:
this.
-
setMaxBatchSize
public Batcher.Options setMaxBatchSize(int maxBatchSize)
Maximum number of items in a single batch (0 = unlimited)- Returns:
this.
-
setMaxBatchByteSize
public Batcher.Options setMaxBatchByteSize(int maxBatchByteSize)
Maximum total byte size of a batch (0 = unlimited)- Returns:
this.
-
-