Skip to content

Commit

Permalink
loadbalancer: deprecate RoundRobinLoadBalancer types
Browse files Browse the repository at this point in the history
Motivation:

We're switching over to the new load balancer API's, but we still
have the older API's sitting around.

Modifications:

Deprecate the old API's and point users to the new.
  • Loading branch information
bryce-anderson committed Dec 19, 2024
1 parent e4d4418 commit 1e2e770
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
* @param <ResolvedAddress> The resolved address type.
* @param <C> The type of connection.
*/
// FIXME: 0.43 - remove deprecated class
final class RoundRobinLoadBalancer<ResolvedAddress, C extends LoadBalancedConnection>
implements TestableLoadBalancer<ResolvedAddress, C> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@
* @param <ResolvedAddress> The resolved address type.
* @param <C> The type of connection.
* @see RoundRobinLoadBalancers
* @deprecated use {@link LoadBalancerBuilder} interfaces instead.
*/
// FIXME: 0.43 - remove deprecated interface
@Deprecated
public interface RoundRobinLoadBalancerBuilder<ResolvedAddress, C extends LoadBalancedConnection> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@

/**
* Provider for {@link RoundRobinLoadBalancerBuilder} that can be registered using {@link java.util.ServiceLoader}.
* @deprecated use the {@link LoadBalancerBuilder} implementations along with {@link LoadBalancerBuilderProvider}
*/
public interface RoundRobinLoadBalancerBuilderProvider {
@Deprecated
public interface RoundRobinLoadBalancerBuilderProvider { // FIXME: 0.43 - remove deprecated interface

/**
* Returns a {@link RoundRobinLoadBalancerBuilder} based on the pre-initialized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* @deprecated this class will be made package-private in the future, use {@link RoundRobinLoadBalancers} to create
* {@link RoundRobinLoadBalancerBuilder}.
*/
@Deprecated // FIXME: 0.43 - make package private
@Deprecated // FIXME: 0.43 - remove in favor of DefaultLoadBalancer types.
public final class RoundRobinLoadBalancerFactory<ResolvedAddress, C extends LoadBalancedConnection>
implements LoadBalancerFactory<ResolvedAddress, C> {

Expand Down Expand Up @@ -110,7 +110,7 @@ public String toString() {
* @deprecated this class will be made package-private in the future, rely on the
* {@link RoundRobinLoadBalancerBuilder} instead.
*/
@Deprecated // FIXME: 0.43 - make package private
@Deprecated // FIXME: 0.43 - Remove in favor of the DefaultLoadBalancer types.
public static final class Builder<ResolvedAddress, C extends LoadBalancedConnection>
implements RoundRobinLoadBalancerBuilder<ResolvedAddress, C> {
private final String id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@

/**
* A factory to create {@link RoundRobinLoadBalancer RoundRobinLoadBalancers}.
* @deprecated use {@link LoadBalancers} instead.
*/
public final class RoundRobinLoadBalancers {
@Deprecated
public final class RoundRobinLoadBalancers { // FIXME: 0.43 - remove deprecated class
private static final Logger LOGGER = LoggerFactory.getLogger(RoundRobinLoadBalancers.class);

private static final List<RoundRobinLoadBalancerBuilderProvider> PROVIDERS;
Expand Down Expand Up @@ -59,8 +61,10 @@ RoundRobinLoadBalancerBuilder<ResolvedAddress, C> applyProviders(
* @param <ResolvedAddress> The resolved address type.
* @param <C> The type of connection.
* @return a new {@link RoundRobinLoadBalancerBuilder}.
* @deprecated use {#{@link LoadBalancers}} constructors instead.
*/
@SuppressWarnings("deprecation")
@Deprecated
public static <ResolvedAddress, C extends LoadBalancedConnection> RoundRobinLoadBalancerBuilder<ResolvedAddress, C>
builder(final String id) {
return applyProviders(id, new RoundRobinLoadBalancerFactory.Builder<>(id));
Expand Down

0 comments on commit 1e2e770

Please sign in to comment.