@BetaApi(value="The surface for batching is not stable yet and may change in the future.") public class FlowController extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FlowController.FlowControlException
Base exception that signals a flow control state.
|
static class |
FlowController.FlowControlRuntimeException
Runtime exception that can be used in place of FlowControlException when an unchecked exception
is required.
|
static class |
FlowController.LimitExceededBehavior
Enumeration of behaviors that FlowController can use in case the flow control limits are
exceeded.
|
static class |
FlowController.MaxOutstandingElementCountReachedException
Exception thrown when client-side flow control is enforced based on the maximum number of
outstanding in-memory elements.
|
static class |
FlowController.MaxOutstandingRequestBytesReachedException
Exception thrown when client-side flow control is enforced based on the maximum number of
unacknowledged in-memory bytes.
|
| Constructor and Description |
|---|
FlowController(DynamicFlowControlSettings settings) |
FlowController(FlowControlSettings settings) |
| Modifier and Type | Method and Description |
|---|---|
void |
decreaseThresholds(long elementSteps,
long byteSteps)
Decrease flow control limits to allow elementSteps fewer elements and byteSteps fewer request
bytes before enforcing flow control.
|
Long |
getCurrentElementCountLimit() |
Long |
getCurrentRequestBytesLimit() |
FlowControlEventStats |
getFlowControlEventStats() |
Long |
getMaxElementCountLimit() |
Long |
getMaxRequestBytesLimit() |
Long |
getMinElementCountLimit() |
Long |
getMinRequestBytesLimit() |
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) |
public FlowController(FlowControlSettings settings)
@InternalApi(value="For google-cloud-java client use only") public FlowController(DynamicFlowControlSettings settings)
public void reserve(long elements,
long bytes)
throws FlowController.FlowControlException
public void release(long elements,
long bytes)
@InternalApi(value="For google-cloud-java client use only")
public void increaseThresholds(long elementSteps,
long byteSteps)
@InternalApi(value="For google-cloud-java client use only")
public void decreaseThresholds(long elementSteps,
long byteSteps)
@InternalApi(value="For internal use by google-cloud-java clients only") @Nullable public Long getMaxElementCountLimit()
@InternalApi(value="For internal use by google-cloud-java clients only") @Nullable public Long getMaxRequestBytesLimit()
@InternalApi(value="For google-cloud-java client use only") @Nullable public Long getMinElementCountLimit()
@InternalApi(value="For google-cloud-java client use only") @Nullable public Long getMinRequestBytesLimit()
@InternalApi(value="For google-cloud-java client use only") @Nullable public Long getCurrentElementCountLimit()
@InternalApi(value="For google-cloud-java client use only") @Nullable public Long getCurrentRequestBytesLimit()
@InternalApi(value="For google-cloud-java client use only") public FlowControlEventStats getFlowControlEventStats()