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.Object
The 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 class
CdsLoadBalancer2.CdsLbState.ClusterState
-
Field Summary
Fields Modifier and Type Field Description private io.grpc.LoadBalancer
childLb
private java.util.Map<java.lang.String,CdsLoadBalancer2.CdsLbState.ClusterState>
clusterStates
private CdsLoadBalancer2.CdsLbState.ClusterState
root
-
Constructor Summary
Constructors Modifier Constructor Description private
CdsLbState(java.lang.String rootCluster)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.private void
handleClusterDiscovered()
private void
handleClusterDiscoveryError(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 void
shutdown()
private void
start()
-
-
-
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)
-
-