Package io.grpc.rls
Class CachingRlsLbClient.AutoCleaningEvictionListener
- java.lang.Object
-
- io.grpc.rls.CachingRlsLbClient.AutoCleaningEvictionListener
-
- All Implemented Interfaces:
LruCache.EvictionListener<RlsProtoData.RouteLookupRequest,CachingRlsLbClient.CacheEntry>
- Enclosing class:
- CachingRlsLbClient
private static final class CachingRlsLbClient.AutoCleaningEvictionListener extends java.lang.Object implements LruCache.EvictionListener<RlsProtoData.RouteLookupRequest,CachingRlsLbClient.CacheEntry>
When anyCachingRlsLbClient.CacheEntryis evicted fromLruCache, it performsCachingRlsLbClient.CacheEntry.cleanup()after originalLruCache.EvictionListeneris finished.
-
-
Field Summary
Fields Modifier and Type Field Description private LruCache.EvictionListener<RlsProtoData.RouteLookupRequest,CachingRlsLbClient.CacheEntry>delegate
-
Constructor Summary
Constructors Constructor Description AutoCleaningEvictionListener(LruCache.EvictionListener<RlsProtoData.RouteLookupRequest,CachingRlsLbClient.CacheEntry> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonEviction(RlsProtoData.RouteLookupRequest key, CachingRlsLbClient.CacheEntry value, LruCache.EvictionType cause)Notifies the listener when any cache entry is evicted.
-
-
-
Field Detail
-
delegate
private final LruCache.EvictionListener<RlsProtoData.RouteLookupRequest,CachingRlsLbClient.CacheEntry> delegate
-
-
Constructor Detail
-
AutoCleaningEvictionListener
AutoCleaningEvictionListener(@Nullable LruCache.EvictionListener<RlsProtoData.RouteLookupRequest,CachingRlsLbClient.CacheEntry> delegate)
-
-
Method Detail
-
onEviction
public void onEviction(RlsProtoData.RouteLookupRequest key, CachingRlsLbClient.CacheEntry value, LruCache.EvictionType cause)
Description copied from interface:LruCache.EvictionListenerNotifies the listener when any cache entry is evicted. Implementation can assume that this method is called serially. Implementation should be non blocking, for long running task consider offloading the task toExecutor.- Specified by:
onEvictionin interfaceLruCache.EvictionListener<RlsProtoData.RouteLookupRequest,CachingRlsLbClient.CacheEntry>
-
-