Package io.grpc.xds
Class LoadBalancerConfigFactory.LegacyLoadBalancingPolicyConverter
- java.lang.Object
-
- io.grpc.xds.LoadBalancerConfigFactory.LegacyLoadBalancingPolicyConverter
-
- Enclosing class:
- LoadBalancerConfigFactory
static class LoadBalancerConfigFactory.LegacyLoadBalancingPolicyConverter extends java.lang.Object
Builds a JSON LB configuration based on the old style of using the xDS Cluster proto message. The lb_policy field is used to select the policy and configuration is extracted from various policy specific fields in Cluster.
-
-
Constructor Summary
Constructors Constructor Description LegacyLoadBalancingPolicyConverter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static com.google.common.collect.ImmutableMap<java.lang.String,?>
convertLeastRequestConfig(Cluster cluster)
Creates a new least_request service config JSON object based on the oldCluster.LeastRequestLbConfig
config message.private static com.google.common.collect.ImmutableMap<java.lang.String,?>
convertRingHashConfig(Cluster cluster)
Creates a new ring_hash service config JSON object based on the oldCluster.RingHashLbConfig
config message.(package private) static com.google.common.collect.ImmutableMap<java.lang.String,?>
convertToServiceConfig(Cluster cluster, boolean enableLeastRequest)
Factory method for creating a new {link LoadBalancerConfigConverter} for a given xDSCluster
.
-
-
-
Method Detail
-
convertToServiceConfig
static com.google.common.collect.ImmutableMap<java.lang.String,?> convertToServiceConfig(Cluster cluster, boolean enableLeastRequest) throws XdsResourceType.ResourceInvalidException
Factory method for creating a new {link LoadBalancerConfigConverter} for a given xDSCluster
.- Throws:
XdsResourceType.ResourceInvalidException
- If theCluster
has an invalid LB configuration.
-
convertRingHashConfig
private static com.google.common.collect.ImmutableMap<java.lang.String,?> convertRingHashConfig(Cluster cluster) throws XdsResourceType.ResourceInvalidException
Creates a new ring_hash service config JSON object based on the oldCluster.RingHashLbConfig
config message.
-
convertLeastRequestConfig
private static com.google.common.collect.ImmutableMap<java.lang.String,?> convertLeastRequestConfig(Cluster cluster)
Creates a new least_request service config JSON object based on the oldCluster.LeastRequestLbConfig
config message.
-
-