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.CacheEntry
is evicted fromLruCache
, it performsCachingRlsLbClient.CacheEntry.cleanup()
after originalLruCache.EvictionListener
is 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 void
onEviction(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.EvictionListener
Notifies 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:
onEviction
in interfaceLruCache.EvictionListener<RlsProtoData.RouteLookupRequest,CachingRlsLbClient.CacheEntry>
-
-