Skip to content

Commit 519dcce

Browse files
committed
Remove unused code.
Remove unused class.
1 parent 41f3cc2 commit 519dcce

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

rls/src/main/java/io/grpc/rls/CachingRlsLbClient.java

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ private BackoffCacheEntry createBackOffEntry(
464464
ChannelLogLevel.DEBUG,
465465
"[RLS Entry {0}] Transition to back off: status={1}, delayNanos={2}",
466466
request, status, delayNanos);
467-
BackoffCacheEntry entry = new BackoffCacheEntry(request, status, backoffPolicy);
467+
BackoffCacheEntry entry = new BackoffCacheEntry(request, status);
468468
// Lock is held, so the task can't execute before the assignment
469469
entry.scheduledFuture = scheduledExecutorService.schedule(
470470
() -> refreshBackoffEntry(entry), delayNanos, TimeUnit.NANOSECONDS);
@@ -787,13 +787,11 @@ public String toString() {
787787
private static final class BackoffCacheEntry extends CacheEntry {
788788

789789
private final Status status;
790-
private final BackoffPolicy backoffPolicy;
791790
private Future<?> scheduledFuture;
792791

793-
BackoffCacheEntry(RouteLookupRequest request, Status status, BackoffPolicy backoffPolicy) {
792+
BackoffCacheEntry(RouteLookupRequest request, Status status) {
794793
super(request);
795794
this.status = checkNotNull(status, "status");
796-
this.backoffPolicy = checkNotNull(backoffPolicy, "backoffPolicy");
797795
}
798796

799797
Status getStatus() {
@@ -970,32 +968,6 @@ public CacheEntry cacheAndClean(RouteLookupRequest key, CacheEntry value) {
970968
}
971969
}
972970

973-
/**
974-
* LbStatusListener refreshes {@link BackoffCacheEntry} when lb state is changed to {@link
975-
* ConnectivityState#READY} from {@link ConnectivityState#TRANSIENT_FAILURE}.
976-
*/
977-
private final class BackoffRefreshListener implements ChildLbStatusListener {
978-
979-
@Nullable
980-
private ConnectivityState prevState = null;
981-
982-
@Override
983-
public void onStatusChanged(ConnectivityState newState) {
984-
if (prevState == ConnectivityState.TRANSIENT_FAILURE
985-
&& newState == ConnectivityState.READY) {
986-
logger.log(ChannelLogLevel.DEBUG, "Transitioning from TRANSIENT_FAILURE to READY");
987-
synchronized (lock) {
988-
for (CacheEntry value : linkedHashLruCache.values()) {
989-
if (value instanceof BackoffCacheEntry) {
990-
refreshBackoffEntry((BackoffCacheEntry) value);
991-
}
992-
}
993-
}
994-
}
995-
prevState = newState;
996-
}
997-
}
998-
999971
/** A header will be added when RLS server respond with additional header data. */
1000972
@VisibleForTesting
1001973
static final Metadata.Key<String> RLS_DATA_KEY =

0 commit comments

Comments
 (0)