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

Commit 149aad0

Browse files
committed
fix precondition
1 parent ec7094f commit 149aad0

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ public BatcherImpl(
141141
>= batchingSettings.getElementCountThreshold(),
142142
"if throttling and batching on element count are enabled, FlowController#minOutstandingElementCount must be greater or equal to elementCountThreshold");
143143
Preconditions.checkArgument(
144-
flowControllerToUse.getMinOutstandingElementCount() == null
144+
flowControllerToUse.getMinOutstandingRequestBytes() == null
145145
|| batchingSettings.getRequestByteThreshold() == null
146-
|| flowControllerToUse.getMinOutstandingElementCount()
146+
|| flowControllerToUse.getMinOutstandingRequestBytes()
147147
>= batchingSettings.getRequestByteThreshold(),
148148
"if throttling and batching on request bytes are enabled, FlowController#minOutstandingRequestBytes must be greater or equal to requestByteThreshold");
149149
}

gax/src/test/java/com/google/api/gax/batching/BatcherImplTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,9 +733,9 @@ public void testConstructors() {
733733
new FlowController(
734734
DynamicFlowControlSettings.newBuilder()
735735
.setLimitExceededBehavior(LimitExceededBehavior.ThrowException)
736-
.setInitialOutstandingRequestBytes(100L)
737-
.setMinOutstandingRequestBytes(50L)
738-
.setMaxOutstandingRequestBytes(200L)
736+
.setInitialOutstandingRequestBytes(5000L)
737+
.setMinOutstandingRequestBytes(1000L)
738+
.setMaxOutstandingRequestBytes(6000L)
739739
.build());
740740
FlowControlEventStats events = new FlowControlEventStats();
741741
try {

0 commit comments

Comments
 (0)