@Internal public final class RlsLoadBalancerProvider extends LoadBalancerProvider
LoadBalancerRegistry.getProvider(java.lang.String)
with the name "rls_experimental".Constructor and Description |
---|
RlsLoadBalancerProvider() |
Modifier and Type | Method and Description |
---|---|
String |
getPolicyName()
Returns the load-balancing policy name associated with this provider, which makes it selectable
via
LoadBalancerRegistry.getProvider(java.lang.String) . |
int |
getPriority()
A priority, from 0 to 10 that this provider should be used, taking the current environment into
consideration.
|
boolean |
isAvailable()
Whether this provider is available for use, taking the current environment into consideration.
|
LoadBalancer |
newLoadBalancer(LoadBalancer.Helper helper)
Creates a
LoadBalancer that will be used inside a channel. |
NameResolver.ConfigOrError |
parseLoadBalancingPolicyConfig(Map<String,?> rawLoadBalancingConfigPolicy)
Parses the config for the Load Balancing policy unpacked from the service config.
|
equals, hashCode, toString
public boolean isAvailable()
LoadBalancerProvider
false
, LoadBalancer.Factory.newLoadBalancer(io.grpc.LoadBalancer.Helper)
is not safe to be called.isAvailable
in class LoadBalancerProvider
public int getPriority()
LoadBalancerProvider
getPriority
in class LoadBalancerProvider
public String getPolicyName()
LoadBalancerProvider
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.
getPolicyName
in class LoadBalancerProvider
public LoadBalancer newLoadBalancer(LoadBalancer.Helper helper)
LoadBalancer.Factory
LoadBalancer
that will be used inside a channel.newLoadBalancer
in class LoadBalancer.Factory
public NameResolver.ConfigOrError parseLoadBalancingPolicyConfig(Map<String,?> rawLoadBalancingConfigPolicy)
LoadBalancerProvider
NameResolver.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. If successful, the load balancing
policy config should be immutable.parseLoadBalancingPolicyConfig
in class LoadBalancerProvider
rawLoadBalancingConfigPolicy
- The Map
representation of the load balancing
policy choice.