Class ThresholdBatcher.Builder<E> (2.48.1)

public static class ThresholdBatcher.Builder<E>

Builder for a ThresholdBatcher.

Inheritance

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

Type Parameter

Name Description
E

Methods

build()

public ThresholdBatcher<E> build()

Build the ThresholdBatcher.

Returns
Type Description
ThresholdBatcher<E>

setBatchMerger(BatchMerger<E> batchMerger)

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

Set the batch merger for the ThresholdBatcher.

Parameter
Name Description
batchMerger BatchMerger<E>
Returns
Type Description
Builder<E>

setExecutor(ScheduledExecutorService executor)

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

Set the executor for the ThresholdBatcher.

Parameter
Name Description
executor ScheduledExecutorService
Returns
Type Description
Builder<E>

setFlowController(BatchingFlowController<E> flowController)

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

Set the flow controller for the ThresholdBatcher.

Parameter
Name Description
flowController BatchingFlowController<E>
Returns
Type Description
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
Name Description
maxDelay org.threeten.bp.Duration
Returns
Type Description
Builder<E>

setReceiver(ThresholdBatchReceiver<E> receiver)

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

Set the threshold batch receiver for the ThresholdBatcher.

Parameter
Name Description
receiver ThresholdBatchReceiver<E>
Returns
Type Description
Builder<E>

setThresholds(Collection<BatchingThreshold<E>> thresholds)

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

Set the thresholds for the ThresholdBatcher.

Parameter
Name Description
thresholds Collection<BatchingThreshold<E>>
Returns
Type Description
Builder<E>