util: Simplify MultiChildLB.getChildLbState()

Tests were converted to use getChildLbStateEag() if the argument was an
EAG, so the instanceof was no longer necessary.
This commit is contained in:
Eric Anderson 2024-08-31 17:53:01 -07:00
parent 8c3496943c
commit 795e2cc3ff
2 changed files with 1 additions and 7 deletions

View File

@ -241,12 +241,6 @@ public abstract class MultiChildLoadBalancer extends LoadBalancer {
@VisibleForTesting
public final ChildLbState getChildLbState(Object key) {
if (key == null) {
return null;
}
if (key instanceof EquivalentAddressGroup) {
key = new Endpoint((EquivalentAddressGroup) key);
}
return childLbStates.get(key);
}

View File

@ -252,7 +252,7 @@ public class LeastRequestLoadBalancerTest {
private LeastRequestLbState getChildLbState(PickResult pickResult) {
EquivalentAddressGroup eag = pickResult.getSubchannel().getAddresses();
return (LeastRequestLbState) loadBalancer.getChildLbState(eag);
return (LeastRequestLbState) loadBalancer.getChildLbStateEag(eag);
}
@Test