Package com.google.api.gax.batching
Enum FlowController.LimitExceededBehavior
- java.lang.Object
-
- java.lang.Enum<FlowController.LimitExceededBehavior>
-
- com.google.api.gax.batching.FlowController.LimitExceededBehavior
-
- All Implemented Interfaces:
Serializable,Comparable<FlowController.LimitExceededBehavior>
- Enclosing class:
- FlowController
public static enum FlowController.LimitExceededBehavior extends Enum<FlowController.LimitExceededBehavior>
Enumeration of behaviors that FlowController can use in case the flow control limits are exceeded.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BlockWaits until the request can be made without exceeding the limit.IgnoreDisables flow-control.ThrowException
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FlowController.LimitExceededBehaviorvalueOf(String name)Returns the enum constant of this type with the specified name.static FlowController.LimitExceededBehavior[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ThrowException
public static final FlowController.LimitExceededBehavior ThrowException
ThrowsFlowController.MaxOutstandingElementCountReachedExceptionorFlowController.MaxOutstandingRequestBytesReachedException.This might be appropriate in interactive scenarios. For example, a web server might catch these exceptions and report to the user that the system is overloaded and that the user could try again later. It could also be useful in applications that implement custom rate-limiting logic.
-
Block
public static final FlowController.LimitExceededBehavior Block
Waits until the request can be made without exceeding the limit.This might be appropriate in batch-processing, where latencies of individual requests are not important.
-
Ignore
public static final FlowController.LimitExceededBehavior Ignore
Disables flow-control.This is provided mainly for debugging and not recommended for production use. Having too many requests in-flight might cause RPCs to fail due to congested network or the computer to run out of memory due to excessive buffering, etc.
-
-
Method Detail
-
values
public static FlowController.LimitExceededBehavior[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FlowController.LimitExceededBehavior c : FlowController.LimitExceededBehavior.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FlowController.LimitExceededBehavior valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
-