util: Remove MultiChildLB.getImmutableChildMap() · grpc/grpc-java@778a00b

@@ -27,7 +27,6 @@

27272828

import com.google.common.base.MoreObjects;

2929

import com.google.common.collect.HashMultiset;

30-

import com.google.common.collect.ImmutableMap;

3130

import com.google.common.collect.Multiset;

3231

import com.google.common.primitives.UnsignedInteger;

3332

import io.grpc.Attributes;

@@ -42,6 +41,7 @@

4241

import io.grpc.xds.client.XdsLogger.XdsLogLevel;

4342

import java.net.SocketAddress;

4443

import java.util.ArrayList;

44+

import java.util.Collection;

4545

import java.util.Collections;

4646

import java.util.HashMap;

4747

import java.util.HashSet;

@@ -213,7 +213,7 @@ protected void updateOverallBalancingState() {

213213

overallState = TRANSIENT_FAILURE;

214214

}

215215216-

RingHashPicker picker = new RingHashPicker(syncContext, ring, getImmutableChildMap());

216+

RingHashPicker picker = new RingHashPicker(syncContext, ring, getChildLbStates());

217217

getHelper().updateBalancingState(overallState, picker);

218218

this.currentConnectivityState = overallState;

219219

}

@@ -345,13 +345,12 @@ private static final class RingHashPicker extends SubchannelPicker {

345345346346

private RingHashPicker(

347347

SynchronizationContext syncContext, List<RingEntry> ring,

348-

ImmutableMap<Object, ChildLbState> subchannels) {

348+

Collection<ChildLbState> children) {

349349

this.syncContext = syncContext;

350350

this.ring = ring;

351-

pickableSubchannels = new HashMap<>(subchannels.size());

352-

for (Map.Entry<Object, ChildLbState> entry : subchannels.entrySet()) {

353-

ChildLbState childLbState = entry.getValue();

354-

pickableSubchannels.put((Endpoint)entry.getKey(),

351+

pickableSubchannels = new HashMap<>(children.size());

352+

for (ChildLbState childLbState : children) {

353+

pickableSubchannels.put((Endpoint)childLbState.getKey(),

355354

new SubchannelView(childLbState, childLbState.getCurrentState()));

356355

}

357356

}