Package com.google.api.gax.batching
Class FlowController
java.lang.Object
com.google.api.gax.batching.FlowController
Provides flow control capability.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Base exception that signals a flow control state.static class
Runtime exception that can be used in place of FlowControlException when an unchecked exception is required.static enum
Enumeration of behaviors that FlowController can use in case the flow control limits are exceeded.static final class
Exception thrown when client-side flow control is enforced based on the maximum number of outstanding in-memory elements.static final class
Exception thrown when client-side flow control is enforced based on the maximum number of unacknowledged in-memory bytes. -
Constructor Summary
ConstructorsConstructorDescriptionFlowController
(DynamicFlowControlSettings settings) FlowController
(FlowControlSettings settings) -
Method Summary
Modifier and TypeMethodDescriptionvoid
decreaseThresholds
(long elementSteps, long byteSteps) Decrease flow control limits to allow elementSteps fewer elements and byteSteps fewer request bytes before enforcing flow control.void
increaseThresholds
(long elementSteps, long byteSteps) Increase flow control limits to allow extra elementSteps elements and byteSteps request bytes before enforcing flow control.void
release
(long elements, long bytes) void
reserve
(long elements, long bytes)
-
Constructor Details
-
FlowController
-
FlowController
@InternalApi("For google-cloud-java client use only") public FlowController(DynamicFlowControlSettings settings)
-
-
Method Details
-
reserve
-
release
public void release(long elements, long bytes) -
increaseThresholds
@InternalApi("For google-cloud-java client use only") public void increaseThresholds(long elementSteps, long byteSteps) Increase flow control limits to allow extra elementSteps elements and byteSteps request bytes before enforcing flow control. -
decreaseThresholds
@InternalApi("For google-cloud-java client use only") public void decreaseThresholds(long elementSteps, long byteSteps) Decrease flow control limits to allow elementSteps fewer elements and byteSteps fewer request bytes before enforcing flow control. -
getMaxElementCountLimit
@InternalApi("For internal use by google-cloud-java clients only") @Nullable public Long getMaxElementCountLimit() -
getMaxRequestBytesLimit
@InternalApi("For internal use by google-cloud-java clients only") @Nullable public Long getMaxRequestBytesLimit() -
getMinElementCountLimit
@InternalApi("For google-cloud-java client use only") @Nullable public Long getMinElementCountLimit() -
getMinRequestBytesLimit
@InternalApi("For google-cloud-java client use only") @Nullable public Long getMinRequestBytesLimit() -
getCurrentElementCountLimit
@InternalApi("For google-cloud-java client use only") @Nullable public Long getCurrentElementCountLimit() -
getCurrentRequestBytesLimit
@InternalApi("For google-cloud-java client use only") @Nullable public Long getCurrentRequestBytesLimit() -
getFlowControlEventStats
@InternalApi("For google-cloud-java client use only") public FlowControlEventStats getFlowControlEventStats()
-