NewBalancer returns a load balancing policy that manages homogeneous child policies each owning a single endpoint. The endpointsharding balancer forwards the LoadBalancingConfig in ClientConn state updates to its children.
(cc balancer.ClientConn, opts balancer.BuildOptions, childBuilder ChildBuilderFunc, esOpts Options)
| 77 | // policies each owning a single endpoint. The endpointsharding balancer |
| 78 | // forwards the LoadBalancingConfig in ClientConn state updates to its children. |
| 79 | func NewBalancer(cc balancer.ClientConn, opts balancer.BuildOptions, childBuilder ChildBuilderFunc, esOpts Options) balancer.Balancer { |
| 80 | es := &endpointSharding{ |
| 81 | cc: cc, |
| 82 | bOpts: opts, |
| 83 | esOpts: esOpts, |
| 84 | childBuilder: childBuilder, |
| 85 | } |
| 86 | es.children.Store(resolver.NewEndpointMap[*balancerWrapper]()) |
| 87 | return es |
| 88 | } |
| 89 | |
| 90 | // endpointSharding is a balancer that wraps child balancers. It creates a child |
| 91 | // balancer with child config for every unique Endpoint received. It updates the |
no outgoing calls