Class ThresholdBatcher.Builder<E> (2.21.0)

public static class ThresholdBatcher.Builder<E>

Builder for a ThresholdBatcher.

Inheritance

java.lang.Object > ThresholdBatcher.Builder<E>

Type Parameter

NameDescription
E

Methods

build()

public ThresholdBatcher<E> build()

Build the ThresholdBatcher.

Returns
TypeDescription
ThresholdBatcher<E>

setBatchMerger(BatchMerger<E> batchMerger)

public ThresholdBatcher.Builder<E> setBatchMerger(BatchMerger<E> batchMerger)

Set the batch merger for the ThresholdBatcher.

Parameter
NameDescription
batchMergerBatchMerger<E>
Returns
TypeDescription
Builder<E>

setExecutor(ScheduledExecutorService executor)

public ThresholdBatcher.Builder<E> setExecutor(ScheduledExecutorService executor)

Set the executor for the ThresholdBatcher.

Parameter
NameDescription
executorScheduledExecutorService
Returns
TypeDescription
Builder<E>

setFlowController(BatchingFlowController<E> flowController)

public ThresholdBatcher.Builder<E> setFlowController(BatchingFlowController<E> flowController)

Set the flow controller for the ThresholdBatcher.

Parameter
NameDescription
flowControllerBatchingFlowController<E>
Returns
TypeDescription
Builder<E>

setMaxDelay(Duration maxDelay)

public ThresholdBatcher.Builder<E> setMaxDelay(Duration maxDelay)

Set the max delay for a batch. This is counted from the first item added to a batch.

Parameter
NameDescription
maxDelayorg.threeten.bp.Duration
Returns
TypeDescription
Builder<E>

setReceiver(ThresholdBatchReceiver<E> receiver)

public ThresholdBatcher.Builder<E> setReceiver(ThresholdBatchReceiver<E> receiver)

Set the threshold batch receiver for the ThresholdBatcher.

Parameter
NameDescription
receiverThresholdBatchReceiver<E>
Returns
TypeDescription
Builder<E>

setThresholds(Collection<BatchingThreshold<E>> thresholds)

public ThresholdBatcher.Builder<E> setThresholds(Collection<BatchingThreshold<E>> thresholds)

Set the thresholds for the ThresholdBatcher.

Parameter
NameDescription
thresholdsCollection<BatchingThreshold<E>>
Returns
TypeDescription
Builder<E>