@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/1771") public abstract class LoadBalancerProvider extends LoadBalancer.Factory
LoadBalancers. Each provider is bounded to a load-balancing policy name.| Constructor and Description |
|---|
LoadBalancerProvider() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Uses identity equality.
|
abstract String |
getPolicyName()
Returns the load-balancing policy name associated with this provider, which makes it selectable
via
LoadBalancerRegistry.getProvider(java.lang.String). |
abstract int |
getPriority()
A priority, from 0 to 10 that this provider should be used, taking the current environment into
consideration.
|
int |
hashCode() |
abstract boolean |
isAvailable()
Whether this provider is available for use, taking the current environment into consideration.
|
NameResolver.Helper.ConfigOrError |
parseLoadBalancingPolicyConfig(Map<String,?> rawLoadBalancingPolicyConfig)
Parses the config for the Load Balancing policy unpacked from the service config.
|
String |
toString() |
newLoadBalancerpublic abstract boolean isAvailable()
false, LoadBalancer.Factory.newLoadBalancer(io.grpc.LoadBalancer.Helper) is not safe to be called.public abstract int getPriority()
public abstract String getPolicyName()
LoadBalancerRegistry.getProvider(java.lang.String). This is called only when the class is loaded. It
shouldn't change, and there is no point doing so.
The policy name should consist of only lower case letters letters, underscore and digits, and can only start with letters.
public NameResolver.Helper.ConfigOrError parseLoadBalancingPolicyConfig(Map<String,?> rawLoadBalancingPolicyConfig)
NameResolver.Helper.ConfigOrError which contains either the successfully parsed config, or the
Status representing the failure to parse. Implementations are expected to not throw
exceptions but return a Status representing the failure.rawLoadBalancingPolicyConfig - The Map representation of the load balancing
policy choice.https://github.com/grpc/proposal/blob/master/A24-lb-policy-config.mdpublic final boolean equals(Object other)