Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhee17 committed Jan 20, 2025
1 parent 7befff4 commit 23d5191
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,7 @@ public final class ClusterEntry extends AbstractListenable<XdsLoadBalancer> impl
@Nullable
private final LocalCluster localCluster;
private final EventExecutor eventExecutor;
private boolean closing;
private final FunctionSelector<XdsLoadBalancer> lbSelector = new FunctionSelector<>(ctx -> {
final XdsLoadBalancer loadBalancer = this.loadBalancer;
if (loadBalancer == null) {
return null;
}
return loadBalancer;
});
private final FunctionSelector<XdsLoadBalancer> lbSelector = new FunctionSelector<>(ctx -> loadBalancer);
private int refCnt;

public ClusterEntry(EventExecutor eventExecutor, @Nullable LocalCluster localCluster) {
Expand All @@ -71,7 +64,7 @@ public UpdatableLoadBalancer updateClusterSnapshot(ClusterSnapshot clusterSnapsh
}
final UpdatableLoadBalancer updatableLoadBalancer =
new UpdatableLoadBalancer(clusterSnapshot, localCluster, localLoadBalancer,
loadBalancer -> this.notifyListeners(loadBalancer));
this::notifyListeners);
loadBalancer = updatableLoadBalancer;
endpointsPool.updateClusterSnapshot(updatableLoadBalancer);
lbSelector.refresh();
Expand Down Expand Up @@ -108,7 +101,6 @@ List<Endpoint> allEndpoints() {

@Override
public CompletableFuture<?> closeAsync() {
closing = true;
if (localCluster != null) {
localCluster.clusterEntry().removeListener(localClusterEntryListener);
}
Expand Down

0 comments on commit 23d5191

Please sign in to comment.