Package org.nuxeo.ecm.core.cache
Class CacheMetrics
- java.lang.Object
-
- org.nuxeo.ecm.core.cache.CacheWrapper
-
- org.nuxeo.ecm.core.cache.CacheMetrics
-
- All Implemented Interfaces:
Cache
,CacheManagement
public class CacheMetrics extends CacheWrapper
-
-
Field Summary
Fields Modifier and Type Field Description protected io.dropwizard.metrics5.MetricName
INVALIDATE_ALL_NAME
protected io.dropwizard.metrics5.Counter
invalidation
protected io.dropwizard.metrics5.Counter
read
protected io.dropwizard.metrics5.Counter
read_hit
protected io.dropwizard.metrics5.MetricName
READ_HIT_NAME
protected io.dropwizard.metrics5.RatioGauge
read_hit_ratio
protected io.dropwizard.metrics5.MetricName
READ_HIT_RATIO_NAME
protected io.dropwizard.metrics5.Counter
read_miss
protected io.dropwizard.metrics5.MetricName
READ_MISS_NAME
protected io.dropwizard.metrics5.MetricName
READ_NAME
protected io.dropwizard.metrics5.MetricRegistry
registry
protected io.dropwizard.metrics5.Gauge<Long>
size
protected io.dropwizard.metrics5.MetricName
SIZE_NAME
protected io.dropwizard.metrics5.Counter
write
protected io.dropwizard.metrics5.MetricName
WRITE_NAME
-
Fields inherited from class org.nuxeo.ecm.core.cache.CacheWrapper
cache
-
-
Constructor Summary
Constructors Constructor Description CacheMetrics(CacheManagement cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Serializable
get(String key)
Get method to retrieve value from cache Must not raise exception if the key is null, but return nullvoid
invalidateAll()
Invalidate all key-value stored in the cacheprotected io.dropwizard.metrics5.MetricName
nameOf(String name)
void
put(String key, Serializable value)
Put method to store aSerializable
valuevoid
start()
Starts this cache.void
stop()
Stops this cache and releases related resources.-
Methods inherited from class org.nuxeo.ecm.core.cache.CacheWrapper
getName, getSize, hasEntry, invalidate, invalidateLocal, invalidateLocalAll, keySet, putLocal, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.cache.Cache
computeIfAbsent
-
-
-
-
Field Detail
-
registry
protected io.dropwizard.metrics5.MetricRegistry registry
-
read
protected io.dropwizard.metrics5.Counter read
-
read_hit
protected io.dropwizard.metrics5.Counter read_hit
-
read_miss
protected io.dropwizard.metrics5.Counter read_miss
-
read_hit_ratio
protected io.dropwizard.metrics5.RatioGauge read_hit_ratio
-
write
protected io.dropwizard.metrics5.Counter write
-
invalidation
protected io.dropwizard.metrics5.Counter invalidation
-
size
protected io.dropwizard.metrics5.Gauge<Long> size
-
READ_HIT_NAME
protected final io.dropwizard.metrics5.MetricName READ_HIT_NAME
-
READ_HIT_RATIO_NAME
protected final io.dropwizard.metrics5.MetricName READ_HIT_RATIO_NAME
-
READ_MISS_NAME
protected final io.dropwizard.metrics5.MetricName READ_MISS_NAME
-
READ_NAME
protected final io.dropwizard.metrics5.MetricName READ_NAME
-
WRITE_NAME
protected final io.dropwizard.metrics5.MetricName WRITE_NAME
-
INVALIDATE_ALL_NAME
protected final io.dropwizard.metrics5.MetricName INVALIDATE_ALL_NAME
-
SIZE_NAME
protected final io.dropwizard.metrics5.MetricName SIZE_NAME
-
-
Constructor Detail
-
CacheMetrics
public CacheMetrics(CacheManagement cache)
-
-
Method Detail
-
nameOf
protected io.dropwizard.metrics5.MetricName nameOf(String name)
-
start
public void start()
Description copied from interface:CacheManagement
Starts this cache.- Specified by:
start
in interfaceCacheManagement
- Overrides:
start
in classCacheWrapper
-
stop
public void stop()
Description copied from interface:CacheManagement
Stops this cache and releases related resources.- Specified by:
stop
in interfaceCacheManagement
- Overrides:
stop
in classCacheWrapper
-
get
public Serializable get(String key)
Description copied from interface:Cache
Get method to retrieve value from cache Must not raise exception if the key is null, but return null- Specified by:
get
in interfaceCache
- Overrides:
get
in classCacheWrapper
- Parameters:
key
- the string key- Returns:
- the
Serializable
value, return null if the key does not exist or if the key is null
-
put
public void put(String key, Serializable value)
Description copied from interface:Cache
Put method to store aSerializable
value- Specified by:
put
in interfaceCache
- Overrides:
put
in classCacheWrapper
- Parameters:
key
- the string key, if null, the value will not be storedvalue
- the value to store, if null, the value will not be stored
-
invalidateAll
public void invalidateAll()
Description copied from interface:Cache
Invalidate all key-value stored in the cache- Specified by:
invalidateAll
in interfaceCache
- Overrides:
invalidateAll
in classCacheWrapper
-
-