Revert "balancer: move Balancer and Picker to V2; delete legacy… (#3315)

This reverts commit 336cf8d76145dc5ebd517fd9c19e14c6822450b3.
This commit is contained in:
Doug Fawley
2020-01-13 13:12:55 -08:00
committed by GitHub
parent 20bce9a0c6
commit c35a580b0c
36 changed files with 2144 additions and 559 deletions

View File

@ -55,14 +55,14 @@ type testingPicker struct {
maxCalled int64
}
func (p *testingPicker) Pick(info balancer.PickInfo) (balancer.PickResult, error) {
func (p *testingPicker) Pick(ctx context.Context, info balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) {
if atomic.AddInt64(&p.maxCalled, -1) < 0 {
return balancer.PickResult{}, fmt.Errorf("pick called to many times (> goroutineCount)")
return nil, nil, fmt.Errorf("pick called to many times (> goroutineCount)")
}
if p.err != nil {
return balancer.PickResult{}, p.err
return nil, nil, p.err
}
return balancer.PickResult{SubConn: p.sc}, nil
return p.sc, nil, nil
}
func (s) TestBlockingPickTimeout(t *testing.T) {