Package com.google.api.gax.batching
Class FlowController
- java.lang.Object
-
- com.google.api.gax.batching.FlowController
-
public class FlowController extends Object
Provides flow control capability.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFlowController.FlowControlExceptionBase exception that signals a flow control state.static classFlowController.FlowControlRuntimeExceptionRuntime exception that can be used in place of FlowControlException when an unchecked exception is required.static classFlowController.LimitExceededBehaviorEnumeration of behaviors that FlowController can use in case the flow control limits are exceeded.static classFlowController.MaxOutstandingElementCountReachedExceptionException thrown when client-side flow control is enforced based on the maximum number of outstanding in-memory elements.static classFlowController.MaxOutstandingRequestBytesReachedExceptionException thrown when client-side flow control is enforced based on the maximum number of unacknowledged in-memory bytes.
-
Constructor Summary
Constructors Constructor Description FlowController(DynamicFlowControlSettings settings)FlowController(FlowControlSettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecreaseThresholds(long elementSteps, long byteSteps)Decrease flow control limits to allow elementSteps fewer elements and byteSteps fewer request bytes before enforcing flow control.LonggetCurrentElementCountLimit()LonggetCurrentRequestBytesLimit()FlowControlEventStatsgetFlowControlEventStats()LonggetMaxElementCountLimit()LonggetMaxRequestBytesLimit()LonggetMinElementCountLimit()LonggetMinRequestBytesLimit()voidincreaseThresholds(long elementSteps, long byteSteps)Increase flow control limits to allow extra elementSteps elements and byteSteps request bytes before enforcing flow control.voidrelease(long elements, long bytes)voidreserve(long elements, long bytes)
-
-
-
Constructor Detail
-
FlowController
public FlowController(FlowControlSettings settings)
-
FlowController
@InternalApi("For google-cloud-java client use only") public FlowController(DynamicFlowControlSettings settings)
-
-
Method Detail
-
reserve
public void reserve(long elements, long bytes) throws FlowController.FlowControlException
-
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()
-
-