balancer: move Balancer and Picker to V2; delete legacy API (#3301)

This commit is contained in:
Doug Fawley
2020-01-10 13:44:48 -08:00
committed by GitHub
parent 69baa3f192
commit 336cf8d761
36 changed files with 559 additions and 2144 deletions

View File

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