public abstract class LookupCache
extends com.google.common.util.concurrent.AbstractIdleService
| Modifier and Type | Class and Description |
|---|---|
static class |
LookupCache.Descriptor<C extends LookupCacheConfiguration> |
static interface |
LookupCache.Factory<T extends LookupCache> |
| Modifier | Constructor and Description |
|---|---|
protected |
LookupCache(String id,
String name,
LookupCacheConfiguration config,
com.codahale.metrics.MetricRegistry metricRegistry) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearError() |
protected abstract void |
doStart() |
protected abstract void |
doStop() |
long |
entryCount()
Get the number of elements in this lookup cache.
|
abstract LookupResult |
get(LookupCacheKey key,
Callable<LookupResult> loader) |
LookupCacheConfiguration |
getConfig() |
Optional<Throwable> |
getError() |
abstract LookupResult |
getIfPresent(LookupCacheKey key) |
String |
id() |
void |
incrHitCount()
Deprecated.
|
void |
incrHitCount(long n) |
void |
incrMissCount()
Deprecated.
|
void |
incrMissCount(long n) |
void |
incrTotalCount()
Deprecated.
|
void |
incrTotalCount(long n) |
com.codahale.metrics.Timer.Context |
lookupTimer() |
String |
name() |
abstract void |
purge() |
abstract void |
purge(LookupCacheKey purgeKey) |
protected void |
setError(Throwable throwable) |
void |
setId(String id) |
protected void |
shutDown() |
protected void |
startUp() |
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toStringprotected LookupCache(String id, String name, LookupCacheConfiguration config, com.codahale.metrics.MetricRegistry metricRegistry)
@Deprecated public void incrTotalCount()
public void incrTotalCount(long n)
@Deprecated public void incrHitCount()
public void incrHitCount(long n)
@Deprecated public void incrMissCount()
public void incrMissCount(long n)
public com.codahale.metrics.Timer.Context lookupTimer()
public long entryCount()
-1L if the cache does not support counting entriesprotected void startUp()
throws Exception
startUp in class com.google.common.util.concurrent.AbstractIdleServiceExceptionprotected void shutDown()
throws Exception
shutDown in class com.google.common.util.concurrent.AbstractIdleServiceExceptionprotected void clearError()
protected void setError(Throwable throwable)
public void setId(String id)
public abstract LookupResult get(LookupCacheKey key, Callable<LookupResult> loader)
public abstract LookupResult getIfPresent(LookupCacheKey key)
public abstract void purge()
public abstract void purge(LookupCacheKey purgeKey)
public LookupCacheConfiguration getConfig()
public String name()
Copyright © 2012–2021 Graylog, Inc.. All rights reserved.