Class CaffeineCache<E>
- java.lang.Object
-
- org.opennms.netmgt.dnsresolver.netty.CaffeineCache<E>
-
public abstract class CaffeineCache<E> extends Object
Underlying cache used to back theCaffeineDnsCache. Uses the Caffeine caching library as opposed to Netty's io.netty.resolver.dns.Cache implementation so that we can: 1) Limit the cache's size (and intelligently evict entries) 2) Expose cache stats- Author:
- jwhite
-
-
Constructor Summary
Constructors Constructor Description CaffeineCache(long maxSize)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcache(String key, E entry, int ttl)voidclear()voidclear(String key)Collection<E>get(String key)protected abstract booleanshouldReplaceAll(E entry)Returnstrueif this entry should replace all other entries that are already cached for the hostname.longsize()com.github.benmanes.caffeine.cache.stats.CacheStatsstats()
-
-
-
Method Detail
-
shouldReplaceAll
protected abstract boolean shouldReplaceAll(E entry)
Returnstrueif this entry should replace all other entries that are already cached for the hostname.
-
clear
public void clear()
-
clear
public void clear(String key)
-
get
public Collection<E> get(String key)
-
size
public long size()
-
stats
public com.github.benmanes.caffeine.cache.stats.CacheStats stats()
-
-