Skip to content

Commit

Permalink
loadbalancer-experimental: remove deprecated APIs
Browse files Browse the repository at this point in the history
Motivation:

We want to remove deprecated API's after the 0.42.46 release.

Note that these API's where removed and then reverted for the
0.42.45 release because it was such a short cycle. See #2968.

Modifications:

Remove the API's.

Result:

What is the result of this change?
  • Loading branch information
bryce-anderson committed Jul 9, 2024
1 parent 991a400 commit 9efabe4
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ public LoadBalancerBuilder<ResolvedAddress, C> loadBalancingPolicy(
return this;
}

@Override
public LoadBalancerBuilder<ResolvedAddress, C> loadBalancerObserver(
@Nullable LoadBalancerObserver loadBalancerObserver) {
return loadBalancerObserver(loadBalancerObserver == null ? null : ignored -> loadBalancerObserver);
}

@Override
public LoadBalancerBuilder<ResolvedAddress, C> loadBalancerObserver(
@Nullable LoadBalancerObserverFactory loadBalancerObserverFactory) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ public LoadBalancerBuilder<ResolvedAddress, C> loadBalancingPolicy(
return this;
}

@Override
public LoadBalancerBuilder<ResolvedAddress, C> loadBalancerObserver(
@Nullable LoadBalancerObserver loadBalancerObserver) {
delegate = delegate.loadBalancerObserver(loadBalancerObserver);
return this;
}

@Override
public LoadBalancerBuilder<ResolvedAddress, C> loadBalancerObserver(
@Nullable LoadBalancerObserverFactory loadBalancerObserverFactory) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,14 @@ public interface LoadBalancerBuilder<ResolvedAddress, C extends LoadBalancedConn
LoadBalancerBuilder<ResolvedAddress, C> loadBalancingPolicy(
LoadBalancingPolicy<ResolvedAddress, C> loadBalancingPolicy);

/**
* Set the {@link LoadBalancerObserver} to use with this load balancer.
* @param loadBalancerObserver the {@link LoadBalancerObserver} to use, or {@code null} to not use an observer.
* @return {code this}
* @deprecated use the overload that takes a {@link LoadBalancerObserverFactory}
*/
@Deprecated // TODO: remove deprecated method after 0.42.46 release.
LoadBalancerBuilder<ResolvedAddress, C> loadBalancerObserver(@Nullable LoadBalancerObserver loadBalancerObserver);

/**
* Set the {@link LoadBalancerObserverFactory} to use with this load balancer.
* @param loadBalancerObserverFactory the {@link LoadBalancerObserverFactory} to use, or {@code null} to not use an
* observer.
* @return {code this}
*/
// TODO: remove the default implementation after 0.42.46 release.
default LoadBalancerBuilder<ResolvedAddress, C> loadBalancerObserver(
@Nullable LoadBalancerObserverFactory loadBalancerObserverFactory) {
return loadBalancerObserver(loadBalancerObserverFactory == null ? null
: loadBalancerObserverFactory.newObserver("<unknown>"));
}
LoadBalancerBuilder<ResolvedAddress, C> loadBalancerObserver(
@Nullable LoadBalancerObserverFactory loadBalancerObserverFactory);

/**
* Set the {@link OutlierDetectorConfig} to use with this load balancer.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public LoadBalancerBuilder<String, TestLoadBalancedConnection> loadBalancingPoli

@Override
public LoadBalancerBuilder<String, TestLoadBalancedConnection> loadBalancerObserver(
@Nullable LoadBalancerObserver loadBalancerObserver) {
@Nullable LoadBalancerObserverFactory loadBalancerObserverFactory) {
throw new IllegalStateException("Cannot set a load balancer observer for old round robin");
}

Expand Down

0 comments on commit 9efabe4

Please sign in to comment.