Package org.graylog2.lookup.caches
Class CaffeineLookupCache
java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
org.graylog2.plugin.lookup.LookupCache
org.graylog2.lookup.caches.CaffeineLookupCache
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic interfaceNested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCaffeineLookupCache(String id, String name, LookupCacheConfiguration c, int processorCount, com.codahale.metrics.MetricRegistry metricRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()protected voiddoStop()longGet the number of elements in this lookup cache.get(LookupCacheKey key, Callable<LookupResult> loader) voidpurge()voidpurge(LookupCacheKey purgeKey) Methods inherited from class org.graylog2.plugin.lookup.LookupCache
clearError, getConfig, getError, id, incrHitCount, incrHitCount, incrMissCount, incrMissCount, incrTotalCount, incrTotalCount, lookupTimer, name, setError, setId, shutDown, startUpMethods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
CaffeineLookupCache
@Inject public CaffeineLookupCache(String id, String name, LookupCacheConfiguration c, @Named("processbuffer_processors") int processorCount, com.codahale.metrics.MetricRegistry metricRegistry)
-
-
Method Details
-
entryCount
public long entryCount()Description copied from class:LookupCacheGet the number of elements in this lookup cache.- Overrides:
entryCountin classLookupCache- Returns:
- the number of elements in this lookup cache or
-1Lif the cache does not support counting entries
-
doStart
- Specified by:
doStartin classLookupCache- Throws:
Exception
-
doStop
- Specified by:
doStopin classLookupCache- Throws:
Exception
-
get
- Specified by:
getin classLookupCache
-
getIfPresent
- Specified by:
getIfPresentin classLookupCache
-
purge
public void purge()- Specified by:
purgein classLookupCache
-
purge
- Specified by:
purgein classLookupCache
-