From 9c7ef74fd7430d5cefc2131e6edaceb40b7f5eb9 Mon Sep 17 00:00:00 2001 From: Mattie Fu Date: Mon, 1 Feb 2021 19:55:35 +0000 Subject: [PATCH] fix precondition --- .../main/java/com/google/api/gax/batching/BatcherImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gax/src/main/java/com/google/api/gax/batching/BatcherImpl.java b/gax/src/main/java/com/google/api/gax/batching/BatcherImpl.java index 4321cde91b..b3bc8eec52 100644 --- a/gax/src/main/java/com/google/api/gax/batching/BatcherImpl.java +++ b/gax/src/main/java/com/google/api/gax/batching/BatcherImpl.java @@ -141,9 +141,9 @@ public BatcherImpl( >= batchingSettings.getElementCountThreshold(), "if throttling and batching on element count are enabled, FlowController#minOutstandingElementCount must be greater or equal to elementCountThreshold"); Preconditions.checkArgument( - flowControllerToUse.getMinOutstandingElementCount() == null + flowControllerToUse.getMinOutstandingRequestBytes() == null || batchingSettings.getRequestByteThreshold() == null - || flowControllerToUse.getMinOutstandingElementCount() + || flowControllerToUse.getMinOutstandingRequestBytes() >= batchingSettings.getRequestByteThreshold(), "if throttling and batching on request bytes are enabled, FlowController#minOutstandingRequestBytes must be greater or equal to requestByteThreshold"); }