lbPicker does two layers of picks: First layer: roundrobin on all servers in serverList, including drops and backends. - If it picks a drop, the RPC will fail as being dropped. - If it picks a backend, do a second layer pick to pick the real backend. Second layer: roundrobin on all READY backends.
| 134 | // |
| 135 | // It's guaranteed that len(serverList) > 0. |
| 136 | type lbPicker struct { |
| 137 | mu sync.Mutex |
| 138 | serverList []*lbpb.Server |
| 139 | serverListNext int |
| 140 | subConns []balancer.SubConn // The subConns that were READY when taking the snapshot. |
| 141 | subConnsNext int |
| 142 | |
| 143 | stats *rpcStats |
| 144 | } |
| 145 | |
| 146 | func newLBPicker(serverList []*lbpb.Server, readySCs []balancer.SubConn, stats *rpcStats) *lbPicker { |
| 147 | return &lbPicker{ |
nothing calls this directly
no outgoing calls
no test coverage detected