Class BatcherFactory<RequestT,ResponseT> (2.20.1)

publicfinalclassBatcherFactory<RequestT,ResponseT>

A Factory class which, for each unique partitionKey, creates a trio including a ThresholdBatcher, BatchExecutor, and ThresholdBatchingForwarder. The ThresholdBatchingForwarder pulls items from the ThresholdBatcher and forwards them to the BatchExecutor for processing.

This is public only for technical reasons, for advanced usage.

Inheritance

java.lang.Object >BatcherFactory<RequestT,ResponseT>

Type Parameters

NameDescription
RequestT
ResponseT

Constructors

BatcherFactory(BatchingDescriptor<RequestT,ResponseT> batchingDescriptor, BatchingSettings batchingSettings, ScheduledExecutorService executor, FlowController flowController)

publicBatcherFactory(BatchingDescriptor<RequestT,ResponseT>batchingDescriptor,BatchingSettingsbatchingSettings,ScheduledExecutorServiceexecutor,FlowControllerflowController)
Parameters
NameDescription
batchingDescriptorBatchingDescriptor<RequestT,ResponseT>
batchingSettingsBatchingSettings
executorScheduledExecutorService
flowControllerFlowController

Methods

getBatchingSettings()

publicBatchingSettingsgetBatchingSettings()

Returns the BatchingSettings object that is associated with this factory.

This is public only for technical reasons, for advanced usage.

Returns
TypeDescription
BatchingSettings

getPushingBatcher(PartitionKey partitionKey)

publicThresholdBatcher<Batch<RequestT,ResponseT>>getPushingBatcher(PartitionKeypartitionKey)

Provides the ThresholdBatcher corresponding to the given partitionKey, or constructs one if it doesn't exist yet. The implementation is thread-safe.

Parameter
NameDescription
partitionKeyPartitionKey
Returns
TypeDescription
ThresholdBatcher<Batch<RequestT,ResponseT>>

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.