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() |
com.codahale.metrics.Gauge<Long> |
entryCount() |
abstract LookupResult |
get(LookupCacheKey key,
Callable<LookupResult> loader) |
LookupCacheConfiguration |
getConfig() |
Optional<Throwable> |
getError() |
abstract LookupResult |
getIfPresent(LookupCacheKey key) |
String |
id() |
void |
incrHitCount() |
void |
incrMissCount() |
void |
incrTotalCount() |
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() |
protected LookupCache(String id, String name, LookupCacheConfiguration config, com.codahale.metrics.MetricRegistry metricRegistry)
public void incrTotalCount()
public void incrHitCount()
public void incrMissCount()
public com.codahale.metrics.Timer.Context lookupTimer()
public com.codahale.metrics.Gauge<Long> entryCount()
protected void startUp() throws Exception
startUp
in class com.google.common.util.concurrent.AbstractIdleService
Exception
protected void shutDown() throws Exception
shutDown
in class com.google.common.util.concurrent.AbstractIdleService
Exception
protected 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–2018 Graylog, Inc.. All rights reserved.