From #11203 :
Seems like the LinkedHashLruCacheTest tests should use cache.fitToLimit() at least some of the time (or maybe it deserves its own test case).
|
this.evictionListener = new SizeHandlingEvictionListener(evictionListener); |
Having the evictionListener handle decrementing estimatedMaxSizeBytes seems like unnecessary complexity that should be eliminated.
|
// new size is larger no need to do cleanup |
The reason given in the comment only describes what happens when it is called from this class, not from RlsAsyncLruCache. The comment should probably just be removed as obvious, but could be changed to there is space available so no need to do cleanup
s/until new size limit/until the size of all entries fits within the limit/
From #11203 :
Seems like the LinkedHashLruCacheTest tests should use cache.fitToLimit() at least some of the time (or maybe it deserves its own test case).
grpc-java/rls/src/main/java/io/grpc/rls/LinkedHashLruCache.java
Line 72 in e4e7f3a
grpc-java/rls/src/main/java/io/grpc/rls/LinkedHashLruCache.java
Line 248 in e4e7f3a