Package com.google.api.gax.batching
Class BatchingSettings.Builder
- java.lang.Object
-
- com.google.api.gax.batching.BatchingSettings.Builder
-
- Enclosing class:
- BatchingSettings
public abstract static class BatchingSettings.Builder extends Object
See the class documentation ofBatchingSettingsfor a description of the different values that can be set.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BatchingSettingsbuild()Build the BatchingSettings object.abstract BatchingSettings.BuildersetDelayThreshold(org.threeten.bp.Duration delayThreshold)Set the delay threshold to use for batching.abstract BatchingSettings.BuildersetElementCountThreshold(Long elementCountThreshold)Set the element count threshold to use for batching.abstract BatchingSettings.BuildersetFlowControlSettings(FlowControlSettings flowControlSettings)Set the flow control settings to be used.abstract BatchingSettings.BuildersetIsEnabled(Boolean enabled)Set if the batch should be enabled.abstract BatchingSettings.BuildersetRequestByteThreshold(Long requestByteThreshold)Set the request byte threshold to use for batching.
-
-
-
Method Detail
-
setElementCountThreshold
public abstract BatchingSettings.Builder setElementCountThreshold(Long elementCountThreshold)
Set the element count threshold to use for batching. After this many elements are accumulated, they will be wrapped up in a batch and sent.
-
setRequestByteThreshold
public abstract BatchingSettings.Builder setRequestByteThreshold(Long requestByteThreshold)
Set the request byte threshold to use for batching. After this many bytes are accumulated, the elements will be wrapped up in a batch and sent.
-
setDelayThreshold
public abstract BatchingSettings.Builder setDelayThreshold(org.threeten.bp.Duration delayThreshold)
Set the delay threshold to use for batching. After this amount of time has elapsed (counting from the first element added), the elements will be wrapped up in a batch and sent. This value should not be set too high, usually on the order of milliseconds. Otherwise, calls might appear to never complete.
-
setIsEnabled
public abstract BatchingSettings.Builder setIsEnabled(Boolean enabled)
Set if the batch should be enabled. If set to false, the batch logic will be disabled and the simple API call will be used. Default to true.
-
setFlowControlSettings
public abstract BatchingSettings.Builder setFlowControlSettings(FlowControlSettings flowControlSettings)
Set the flow control settings to be used.
-
build
public BatchingSettings build()
Build the BatchingSettings object.
-
-