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 Object
implements LruCache.EvictionListener<RlsProtoData.RouteLookupRequest, CachingRlsLbClient.CacheEntry>
When any
CachingRlsLbClient.CacheEntry is evicted from LruCache, it performs CachingRlsLbClient.CacheEntry.cleanup() after original LruCache.EvictionListener is finished.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LruCache.EvictionListener<RlsProtoData.RouteLookupRequest, CachingRlsLbClient.CacheEntry> -
Constructor Summary
ConstructorsConstructorDescriptionAutoCleaningEvictionListener(LruCache.EvictionListener<RlsProtoData.RouteLookupRequest, CachingRlsLbClient.CacheEntry> delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidonEviction(RlsProtoData.RouteLookupRequest key, CachingRlsLbClient.CacheEntry value, LruCache.EvictionType cause) Notifies the listener when any cache entry is evicted.
-
Field Details
-
delegate
private final LruCache.EvictionListener<RlsProtoData.RouteLookupRequest, CachingRlsLbClient.CacheEntry> delegate
-
-
Constructor Details
-
AutoCleaningEvictionListener
AutoCleaningEvictionListener(@Nullable LruCache.EvictionListener<RlsProtoData.RouteLookupRequest, CachingRlsLbClient.CacheEntry> delegate)
-
-
Method Details
-
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>
-