Package io.grpc.serviceconfig
Enum ServiceConfig.LoadBalancingPolicy
- java.lang.Object
-
- java.lang.Enum<ServiceConfig.LoadBalancingPolicy>
-
- io.grpc.serviceconfig.ServiceConfig.LoadBalancingPolicy
-
- All Implemented Interfaces:
com.google.protobuf.Internal.EnumLite,com.google.protobuf.ProtocolMessageEnum,Serializable,Comparable<ServiceConfig.LoadBalancingPolicy>
- Enclosing class:
- ServiceConfig
public static enum ServiceConfig.LoadBalancingPolicy extends Enum<ServiceConfig.LoadBalancingPolicy> implements com.google.protobuf.ProtocolMessageEnum
Load balancing policy. Note that load_balancing_policy is deprecated in favor of load_balancing_config; the former will be used only if the latter is unset. If no LB policy is configured here, then the default is pick_first. If the policy name is set via the client API, that value overrides the value specified here. If the deprecated load_balancing_policy field is used, note that if the resolver returns at least one balancer address (as opposed to backend addresses), gRPC will use grpclb (see https://github.com/grpc/grpc/blob/master/doc/load-balancing.md), regardless of what policy is configured here. However, if the resolver returns at least one backend address in addition to the balancer address(es), the client may fall back to the requested policy if it is unable to reach any of the grpclb load balancers.
Protobuf enumgrpc.service_config.ServiceConfig.LoadBalancingPolicy
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ROUND_ROBINROUND_ROBIN = 1;UNRECOGNIZEDUNSPECIFIEDUNSPECIFIED = 0;
-
Field Summary
Fields Modifier and Type Field Description static intROUND_ROBIN_VALUEROUND_ROBIN = 1;static intUNSPECIFIED_VALUEUNSPECIFIED = 0;
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ServiceConfig.LoadBalancingPolicyforNumber(int value)static com.google.protobuf.Descriptors.EnumDescriptorgetDescriptor()com.google.protobuf.Descriptors.EnumDescriptorgetDescriptorForType()intgetNumber()com.google.protobuf.Descriptors.EnumValueDescriptorgetValueDescriptor()static com.google.protobuf.Internal.EnumLiteMap<ServiceConfig.LoadBalancingPolicy>internalGetValueMap()static ServiceConfig.LoadBalancingPolicyvalueOf(int value)Deprecated.static ServiceConfig.LoadBalancingPolicyvalueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)Returns the enum constant of this type with the specified name.static ServiceConfig.LoadBalancingPolicyvalueOf(String name)Returns the enum constant of this type with the specified name.static ServiceConfig.LoadBalancingPolicy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNSPECIFIED
public static final ServiceConfig.LoadBalancingPolicy UNSPECIFIED
UNSPECIFIED = 0;
-
ROUND_ROBIN
public static final ServiceConfig.LoadBalancingPolicy ROUND_ROBIN
ROUND_ROBIN = 1;
-
UNRECOGNIZED
public static final ServiceConfig.LoadBalancingPolicy UNRECOGNIZED
-
-
Field Detail
-
UNSPECIFIED_VALUE
public static final int UNSPECIFIED_VALUE
UNSPECIFIED = 0;- See Also:
- Constant Field Values
-
ROUND_ROBIN_VALUE
public static final int ROUND_ROBIN_VALUE
ROUND_ROBIN = 1;- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static ServiceConfig.LoadBalancingPolicy[] 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 (ServiceConfig.LoadBalancingPolicy c : ServiceConfig.LoadBalancingPolicy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ServiceConfig.LoadBalancingPolicy 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
-
getNumber
public final int getNumber()
- Specified by:
getNumberin interfacecom.google.protobuf.Internal.EnumLite- Specified by:
getNumberin interfacecom.google.protobuf.ProtocolMessageEnum
-
valueOf
@Deprecated public static ServiceConfig.LoadBalancingPolicy valueOf(int value)
Deprecated.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:
value- 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
-
forNumber
public static ServiceConfig.LoadBalancingPolicy forNumber(int value)
- Parameters:
value- The numeric wire value of the corresponding enum entry.- Returns:
- The enum associated with the given numeric wire value.
-
internalGetValueMap
public static com.google.protobuf.Internal.EnumLiteMap<ServiceConfig.LoadBalancingPolicy> internalGetValueMap()
-
getValueDescriptor
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
- Specified by:
getValueDescriptorin interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptorForType
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptor
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
-
valueOf
public static ServiceConfig.LoadBalancingPolicy valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
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:
desc- 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
-
-