Skip to content

Commit f9fa00b

Browse files
committed
removed HasNode
1 parent 3b509fc commit f9fa00b

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

internal/balancer/balancer.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,6 @@ type Balancer struct {
4646
onApplyDiscoveredEndpoints []func(ctx context.Context, endpoints []endpoint.Info)
4747
}
4848

49-
func (b *Balancer) HasNode(id uint32) bool {
50-
if b.config.SingleConn {
51-
return true
52-
}
53-
b.mu.RLock()
54-
defer b.mu.RUnlock()
55-
if _, has := b.connectionsState.connByNodeID[id]; has {
56-
return true
57-
}
58-
59-
return false
60-
}
61-
6249
func (b *Balancer) OnUpdate(onApplyDiscoveredEndpoints func(ctx context.Context, endpoints []endpoint.Info)) {
6350
b.mu.WithLock(func() {
6451
b.onApplyDiscoveredEndpoints = append(b.onApplyDiscoveredEndpoints, onApplyDiscoveredEndpoints)

testutil/driver.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ type balancerStub struct {
138138
) (grpc.ClientStream, error)
139139
}
140140

141-
func (b *balancerStub) HasNode(id uint32) bool {
142-
return true
143-
}
144-
145141
func (b *balancerStub) Invoke(
146142
ctx context.Context,
147143
method string,

0 commit comments

Comments
 (0)