Package io.grpc.xds
Class LoadBalancerConfigFactory.LegacyLoadBalancingPolicyConverter
java.lang.Object
io.grpc.xds.LoadBalancerConfigFactory.LegacyLoadBalancingPolicyConverter
- Enclosing class:
LoadBalancerConfigFactory
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 -
Method Summary
Modifier and TypeMethodDescriptionprivate static com.google.common.collect.ImmutableMap
<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
<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
<String, ?> convertToServiceConfig
(Cluster cluster, boolean enableLeastRequest) Factory method for creating a new {link LoadBalancerConfigConverter} for a given xDSCluster
.
-
Constructor Details
-
LegacyLoadBalancingPolicyConverter
LegacyLoadBalancingPolicyConverter()
-
-
Method Details
-
convertToServiceConfig
static com.google.common.collect.ImmutableMap<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<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<String,?> convertLeastRequestConfig(Cluster cluster) Creates a new least_request service config JSON object based on the oldCluster.LeastRequestLbConfig
config message.
-