Class RlsLoadBalancerProvider
java.lang.Object
io.grpc.LoadBalancer.Factory
io.grpc.LoadBalancerProvider
io.grpc.rls.RlsLoadBalancerProvider
The provider for the "rls_experimental" balancing policy. This class should not be directly
referenced in code. The policy should be accessed through
LoadBalancerRegistry.getProvider(String) with the name "rls_experimental".-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the load-balancing policy name associated with this provider, which makes it selectable viaLoadBalancerRegistry.getProvider(String).intA priority, from 0 to 10 that this provider should be used, taking the current environment into consideration.booleanWhether this provider is available for use, taking the current environment into consideration.newLoadBalancer(LoadBalancer.Helper helper) Creates aLoadBalancerthat will be used inside a channel.parseLoadBalancingPolicyConfig(Map<String, ?> rawLoadBalancingConfigPolicy) Parses the config for the Load Balancing policy unpacked from the service config.Methods inherited from class LoadBalancerProvider
equals, hashCode, toString
-
Constructor Details
-
RlsLoadBalancerProvider
public RlsLoadBalancerProvider()
-
-
Method Details
-
isAvailable
public boolean isAvailable()Description copied from class:LoadBalancerProviderWhether this provider is available for use, taking the current environment into consideration. Iffalse,LoadBalancer.Factory.newLoadBalancer(LoadBalancer.Helper)is not safe to be called.- Specified by:
isAvailablein classLoadBalancerProvider
-
getPriority
public int getPriority()Description copied from class:LoadBalancerProviderA priority, from 0 to 10 that this provider should be used, taking the current environment into consideration. 5 should be considered the default, and then tweaked based on environment detection. A priority of 0 does not imply that the provider wouldn't work; just that it should be last in line.- Specified by:
getPriorityin classLoadBalancerProvider
-
getPolicyName
Description copied from class:LoadBalancerProviderReturns the load-balancing policy name associated with this provider, which makes it selectable viaLoadBalancerRegistry.getProvider(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.
- Specified by:
getPolicyNamein classLoadBalancerProvider
-
newLoadBalancer
Description copied from class:LoadBalancer.FactoryCreates aLoadBalancerthat will be used inside a channel.- Specified by:
newLoadBalancerin classLoadBalancer.Factory
-
parseLoadBalancingPolicyConfig
public NameResolver.ConfigOrError parseLoadBalancingPolicyConfig(Map<String, ?> rawLoadBalancingConfigPolicy) Description copied from class:LoadBalancerProviderParses the config for the Load Balancing policy unpacked from the service config. This will return aNameResolver.ConfigOrErrorwhich contains either the successfully parsed config, or theStatusrepresenting 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.- Overrides:
parseLoadBalancingPolicyConfigin classLoadBalancerProvider- Parameters:
rawLoadBalancingConfigPolicy- TheMaprepresentation of the load balancing policy choice.- Returns:
- a tuple of the fully parsed and validated balancer configuration, else the Status.
- See Also:
-