Package io.grpc.xds
Class CdsLoadBalancer2.CdsLbState
- java.lang.Object
-
- io.grpc.xds.CdsLoadBalancer2.CdsLbState
-
- Enclosing class:
- CdsLoadBalancer2
private final class CdsLoadBalancer2.CdsLbState extends java.lang.ObjectThe state of a CDS working session ofCdsLoadBalancer2. Created and started when receiving the CDS LB policy config with the top-level cluster name.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classCdsLoadBalancer2.CdsLbState.ClusterState
-
Field Summary
Fields Modifier and Type Field Description private io.grpc.LoadBalancerchildLbprivate java.util.Map<java.lang.String,CdsLoadBalancer2.CdsLbState.ClusterState>clusterStatesprivate CdsLoadBalancer2.CdsLbState.ClusterStateroot
-
Constructor Summary
Constructors Modifier Constructor Description privateCdsLbState(java.lang.String rootCluster)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddAncestors(java.util.Set<java.lang.String> ancestors, CdsLoadBalancer2.CdsLbState.ClusterState clusterState, java.util.Map<CdsLoadBalancer2.CdsLbState.ClusterState,java.util.List<CdsLoadBalancer2.CdsLbState.ClusterState>> parentClusters)Recursively add all parents to the ancestors list.private voidhandleClusterDiscovered()private voidhandleClusterDiscoveryError(io.grpc.Status error)private java.util.List<java.lang.String>identifyLoops(CdsLoadBalancer2.CdsLbState.ClusterState clusterState, java.util.Map<CdsLoadBalancer2.CdsLbState.ClusterState,java.util.List<CdsLoadBalancer2.CdsLbState.ClusterState>> parentClusters)Returns children that would cause loops and builds up the parentClusters map.private voidshutdown()private voidstart()
-
-
-
Field Detail
-
root
private final CdsLoadBalancer2.CdsLbState.ClusterState root
-
clusterStates
private final java.util.Map<java.lang.String,CdsLoadBalancer2.CdsLbState.ClusterState> clusterStates
-
childLb
private io.grpc.LoadBalancer childLb
-
-
Method Detail
-
start
private void start()
-
shutdown
private void shutdown()
-
handleClusterDiscovered
private void handleClusterDiscovered()
-
identifyLoops
private java.util.List<java.lang.String> identifyLoops(CdsLoadBalancer2.CdsLbState.ClusterState clusterState, java.util.Map<CdsLoadBalancer2.CdsLbState.ClusterState,java.util.List<CdsLoadBalancer2.CdsLbState.ClusterState>> parentClusters)
Returns children that would cause loops and builds up the parentClusters map.
-
addAncestors
private void addAncestors(java.util.Set<java.lang.String> ancestors, CdsLoadBalancer2.CdsLbState.ClusterState clusterState, java.util.Map<CdsLoadBalancer2.CdsLbState.ClusterState,java.util.List<CdsLoadBalancer2.CdsLbState.ClusterState>> parentClusters)Recursively add all parents to the ancestors list.
-
handleClusterDiscoveryError
private void handleClusterDiscoveryError(io.grpc.Status error)
-
-