Package org.graylog2.plugin.lookup
Class LookupCache
java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
org.graylog2.plugin.lookup.LookupCache
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
- Direct Known Subclasses:
CaffeineLookupCache,NullCache
public abstract class LookupCache
extends com.google.common.util.concurrent.AbstractIdleService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfaceLookupCache.Factory<T extends LookupCache>Nested 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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLookupCache(String id, String name, LookupCacheConfiguration config, com.codahale.metrics.MetricRegistry metricRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected abstract voiddoStart()protected abstract voiddoStop()longGet the number of elements in this lookup cache.abstract LookupResultget(LookupCacheKey key, Callable<LookupResult> loader) getError()abstract LookupResultid()voidDeprecated.voidincrHitCount(long n) voidDeprecated.voidincrMissCount(long n) voidDeprecated.voidincrTotalCount(long n) com.codahale.metrics.Timer.Contextname()abstract voidpurge()abstract voidpurge(LookupCacheKey purgeKey) protected voidvoidprotected voidshutDown()protected voidstartUp()Methods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString
-
Constructor Details
-
LookupCache
protected LookupCache(String id, String name, LookupCacheConfiguration config, com.codahale.metrics.MetricRegistry metricRegistry)
-
-
Method Details
-
incrTotalCount
Deprecated. -
incrTotalCount
public void incrTotalCount(long n) -
incrHitCount
Deprecated. -
incrHitCount
public void incrHitCount(long n) -
incrMissCount
Deprecated. -
incrMissCount
public void incrMissCount(long n) -
lookupTimer
public com.codahale.metrics.Timer.Context lookupTimer() -
entryCount
public long entryCount()Get the number of elements in this lookup cache.- Returns:
- the number of elements in this lookup cache or
-1Lif the cache does not support counting entries
-
startUp
- Specified by:
startUpin classcom.google.common.util.concurrent.AbstractIdleService- Throws:
Exception
-
doStart
- Throws:
Exception
-
shutDown
- Specified by:
shutDownin classcom.google.common.util.concurrent.AbstractIdleService- Throws:
Exception
-
doStop
- Throws:
Exception
-
clearError
protected void clearError() -
getError
-
setError
-
id
-
setId
-
get
-
getIfPresent
-
purge
public abstract void purge() -
purge
-
getConfig
-
name
-