(cc balancer.ClientConn, bOpts balancer.BuildOptions)
| 100 | type bb struct{} |
| 101 | |
| 102 | func (bb) Build(cc balancer.ClientConn, bOpts balancer.BuildOptions) balancer.Balancer { |
| 103 | b := &wrrBalancer{ |
| 104 | ClientConn: cc, |
| 105 | target: bOpts.Target.String(), |
| 106 | metricsRecorder: cc.MetricsRecorder(), |
| 107 | addressWeights: resolver.NewAddressMapV2[*endpointWeight](), |
| 108 | endpointToWeight: resolver.NewEndpointMap[*endpointWeight](), |
| 109 | scToWeight: make(map[balancer.SubConn]*endpointWeight), |
| 110 | } |
| 111 | |
| 112 | b.child = endpointsharding.NewBalancer(b, bOpts, balancer.Get(pickfirst.Name).Build, endpointsharding.Options{}) |
| 113 | b.logger = prefixLogger(b) |
| 114 | if b.logger.V(2) { |
| 115 | b.logger.Infof("Created") |
| 116 | } |
| 117 | return b |
| 118 | } |
| 119 | |
| 120 | func (bb) ParseConfig(js json.RawMessage) (serviceconfig.LoadBalancingConfig, error) { |
| 121 | lbCfg := &lbConfig{ |
nothing calls this directly
no test coverage detected