util: Remove MultiChildLB.getImmutableChildMap() · grpc/grpc-java@778a00b
@@ -27,7 +27,6 @@
27272828import com.google.common.base.MoreObjects;
2929import com.google.common.collect.HashMultiset;
30-import com.google.common.collect.ImmutableMap;
3130import com.google.common.collect.Multiset;
3231import com.google.common.primitives.UnsignedInteger;
3332import io.grpc.Attributes;
@@ -42,6 +41,7 @@
4241import io.grpc.xds.client.XdsLogger.XdsLogLevel;
4342import java.net.SocketAddress;
4443import java.util.ArrayList;
44+import java.util.Collection;
4545import java.util.Collections;
4646import java.util.HashMap;
4747import java.util.HashSet;
@@ -213,7 +213,7 @@ protected void updateOverallBalancingState() {
213213overallState = TRANSIENT_FAILURE;
214214 }
215215216-RingHashPicker picker = new RingHashPicker(syncContext, ring, getImmutableChildMap());
216+RingHashPicker picker = new RingHashPicker(syncContext, ring, getChildLbStates());
217217getHelper().updateBalancingState(overallState, picker);
218218this.currentConnectivityState = overallState;
219219 }
@@ -345,13 +345,12 @@ private static final class RingHashPicker extends SubchannelPicker {
345345346346private RingHashPicker(
347347SynchronizationContext syncContext, List<RingEntry> ring,
348-ImmutableMap<Object, ChildLbState> subchannels) {
348+Collection<ChildLbState> children) {
349349this.syncContext = syncContext;
350350this.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(),
355354new SubchannelView(childLbState, childLbState.getCurrentState()));
356355 }
357356 }