diff --git a/src/main/java/com/google/api/gax/bundling/ExternalThreshold.java b/src/main/java/com/google/api/gax/bundling/ExternalThreshold.java index e2ca3e0a1817..b1662a4ce8e3 100644 --- a/src/main/java/com/google/api/gax/bundling/ExternalThreshold.java +++ b/src/main/java/com/google/api/gax/bundling/ExternalThreshold.java @@ -32,10 +32,10 @@ public interface ExternalThreshold { /** - * Make a copy of this threshold with the accumulated value reset. + * Make a copy of this threshold but with the accumulated value zeroed. * * Any calls into this function from ThresholdBundler will be under a lock. */ - ExternalThreshold copyReset(); + ExternalThreshold copyWithZeroedValue(); } diff --git a/src/main/java/com/google/api/gax/bundling/ThresholdBundler.java b/src/main/java/com/google/api/gax/bundling/ThresholdBundler.java index 9f212a437aa4..43a478f9e6a7 100644 --- a/src/main/java/com/google/api/gax/bundling/ThresholdBundler.java +++ b/src/main/java/com/google/api/gax/bundling/ThresholdBundler.java @@ -313,7 +313,7 @@ private static ImmutableList> copyResetExternalThreshol ImmutableList.Builder> resetThresholds = ImmutableList.>builder(); for (ExternalThreshold threshold : thresholds) { - resetThresholds.add(threshold.copyReset()); + resetThresholds.add(threshold.copyWithZeroedValue()); } return resetThresholds.build(); } diff --git a/src/main/java/com/google/api/gax/grpc/BlockingCallThreshold.java b/src/main/java/com/google/api/gax/grpc/BlockingCallThreshold.java index 4692e3e9c3b9..0ad3449ca399 100644 --- a/src/main/java/com/google/api/gax/grpc/BlockingCallThreshold.java +++ b/src/main/java/com/google/api/gax/grpc/BlockingCallThreshold.java @@ -34,7 +34,7 @@ public void handleEvent(ThresholdBundleHandle bundleHandle, Object event) { } @Override - public ExternalThreshold copyReset() { + public ExternalThreshold copyWithZeroedValue() { return new BlockingCallThreshold(threshold); } diff --git a/src/test/java/com/google/api/gax/bundling/ThresholdBundlerTest.java b/src/test/java/com/google/api/gax/bundling/ThresholdBundlerTest.java index 030f269952ba..6a8919428d65 100644 --- a/src/test/java/com/google/api/gax/bundling/ThresholdBundlerTest.java +++ b/src/test/java/com/google/api/gax/bundling/ThresholdBundlerTest.java @@ -191,7 +191,7 @@ public void handleEvent(ThresholdBundleHandle bundleHandle, Object event) { } @Override - public ExternalThreshold copyReset() { + public ExternalThreshold copyWithZeroedValue() { // No state is kept, so this is safe return this; }