Skip to content

Commit

Permalink
loadbalancer-experimental: remove/hide unused public API (#3139)
Browse files Browse the repository at this point in the history
Motivation:

Reduce public API that is not currently used.

Modifications:

- Make `LoadBalancingPolicy.name()` visibility pkg-private;
- Remove `RequestTracker.ErrorClass.isLocal()`;
  • Loading branch information
idelpivnitskiy authored Dec 14, 2024
1 parent 9924380 commit b4be7d1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public abstract class LoadBalancingPolicy<ResolvedAddress, C extends LoadBalance
* The name of the load balancing policy.
* @return the name of the load balancing policy
*/
public abstract String name();
abstract String name();

@Override
public abstract String toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ HostSelector<ResolvedAddress, C> buildSelector(final List<Host<ResolvedAddress,
}

@Override
public String name() {
String name() {
return "P2C";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,21 @@ enum ErrorClass {
/**
* Failures caused locally, these would be things that failed due to an exception locally.
*/
LOCAL_ORIGIN_REQUEST_FAILED(true),
LOCAL_ORIGIN_REQUEST_FAILED,

/**
* Failures related to locally enforced timeouts waiting for responses from the peer.
*/
EXT_ORIGIN_TIMEOUT(false),
EXT_ORIGIN_TIMEOUT,

/**
* Failures returned from the remote peer. This will be things like 5xx responses.
*/
EXT_ORIGIN_REQUEST_FAILED(false),
EXT_ORIGIN_REQUEST_FAILED,

/**
* Failure due to cancellation.
*/
CANCELLED(true);

private final boolean isLocal;

ErrorClass(boolean isLocal) {
this.isLocal = isLocal;
}

public boolean isLocal() {
return isLocal;
}
CANCELLED
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ HostSelector<ResolvedAddress, C> buildSelector(final List<Host<ResolvedAddress,
}

@Override
public String name() {
String name() {
return "RoundRobin";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ private static class TestLoadBalancerPolicy extends LoadBalancingPolicy<String,
int rebuilds;

@Override
public String name() {
String name() {
return "TestPolicy";
}

Expand Down

0 comments on commit b4be7d1

Please sign in to comment.