Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Commit 2ce5a2f

Browse files
authored
Document default values for BatchingSettings (#639)
"Fixes" #543
1 parent 122eda6 commit 2ce5a2f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

gax/src/main/java/com/google/api/gax/batching/BatchingSettings.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
/**
3939
* Represents the batching settings to use for an API method that is capable of batching.
4040
*
41+
* <p>By default the settings are configured to <b>not</b> use batching (i.e. the batch size
42+
* threshold is 1). This is the safest default behavior, which has meaning in all possible
43+
* scenarios. Users are expected to configure actual batching thresholds explicitly: the element
44+
* count, the request bytes count and the delay.
45+
*
4146
* <p>Warning: With the wrong settings, it is possible to cause long periods of dead waiting time.
4247
*
4348
* <p>When batching is turned on for an API method, a call to that method will result in the request
@@ -50,12 +55,13 @@
5055
*
5156
* <ul>
5257
* <li><b>Delay Threshold</b>: Counting from the time that the first message is queued, once this
53-
* delay has passed, then send the batch.
58+
* delay has passed, then send the batch. The default value is 1 millisecond.
5459
* <li><b>Message Count Threshold</b>: Once this many messages are queued, send all of the
55-
* messages in a single call, even if the delay threshold hasn't elapsed yet.
60+
* messages in a single call, even if the delay threshold hasn't elapsed yet. The default
61+
* value is 1 message.
5662
* <li><b>Request Byte Threshold</b>: Once the number of bytes in the batched request reaches this
5763
* threshold, send all of the messages in a single call, even if neither the delay or message
58-
* count thresholds have been exceeded yet.
64+
* count thresholds have been exceeded yet. The default value is 1 byte.
5965
* </ul>
6066
*
6167
* <p>These thresholds are treated as triggers, not as limits. Thus, if a request is made with 2x

0 commit comments

Comments
 (0)