Class Batcher.Options
Batcher behaves. All limits are inclusive and
validated by the Batcher where 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 by Batcher.SizableItem.getByteSize(). A value of 0 disables this bound.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintMaximum total byte size of a batch (0 = unlimited)intMaximum number of items in a single batch (0 = unlimited)intMaximum number of concurrent handler threadsintMinimum number of items required to form a batchsetMaxBatchByteSize(int maxBatchByteSize) Maximum total byte size of a batch (0 = unlimited)setMaxBatchSize(int maxBatchSize) Maximum number of items in a single batch (0 = unlimited)setMaxHandlers(int maxHandlers) Maximum number of concurrent handler threadssetMinBatchSize(int minBatchSize) Minimum number of items required to form a batch
-
Constructor Details
-
Options
public Options()
-
-
Method Details
-
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
Maximum number of concurrent handler threads- Returns:
this.
-
setMinBatchSize
Minimum number of items required to form a batch- Returns:
this.
-
setMaxBatchSize
Maximum number of items in a single batch (0 = unlimited)- Returns:
this.
-
setMaxBatchByteSize
Maximum total byte size of a batch (0 = unlimited)- Returns:
this.
-