Skip to content

Commit 909c4bc

Browse files
committed
util: Remove minor convenience functions from MultiChildLB
These were once needed to be overridden (e.g., by RoundRobinLB), but now nothing overrides them and MultiChildLB doesn't even call one of them.
1 parent 75012a5 commit 909c4bc

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

util/src/main/java/io/grpc/util/MultiChildLoadBalancer.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -173,28 +173,11 @@ protected ResolvedAddresses getChildAddresses(Object key, ResolvedAddresses reso
173173
@Override
174174
public void handleNameResolutionError(Status error) {
175175
if (currentConnectivityState != READY) {
176-
helper.updateBalancingState(TRANSIENT_FAILURE, getErrorPicker(error));
176+
helper.updateBalancingState(
177+
TRANSIENT_FAILURE, new FixedResultPicker(PickResult.withError(error)));
177178
}
178179
}
179180

180-
/**
181-
* Handle the name resolution error only for the specified child.
182-
*
183-
* <p/>Override if you need special handling.
184-
*/
185-
protected void handleNameResolutionError(ChildLbState child, Status error) {
186-
child.lb.handleNameResolutionError(error);
187-
}
188-
189-
/**
190-
* Creates a new picker representing an error status.
191-
*
192-
* <p/>Override to produce a custom picker when there are errors.
193-
*/
194-
protected SubchannelPicker getErrorPicker(Status error) {
195-
return new FixedResultPicker(PickResult.withError(error));
196-
}
197-
198181
@Override
199182
public void shutdown() {
200183
logger.log(Level.FINE, "Shutdown");

xds/src/main/java/io/grpc/xds/ClusterManagerLoadBalancer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,12 @@ public void handleNameResolutionError(Status error) {
183183
for (ChildLbState state : getChildLbStates()) {
184184
if (((ClusterManagerLbState) state).deletionTimer == null) {
185185
gotoTransientFailure = false;
186-
handleNameResolutionError(state, error);
186+
state.getLb().handleNameResolutionError(error);
187187
}
188188
}
189189
if (gotoTransientFailure) {
190-
getHelper().updateBalancingState(TRANSIENT_FAILURE, getErrorPicker(error));
190+
getHelper().updateBalancingState(
191+
TRANSIENT_FAILURE, new FixedResultPicker(PickResult.withError(error)));
191192
}
192193
}
193194

0 commit comments

Comments
 (0)