Package org.apache.druid.client.cache
Class MemcachedCache
- java.lang.Object
-
- org.apache.druid.client.cache.MemcachedCache
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Cache
public class MemcachedCache extends Object implements Cache
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.druid.client.cache.Cache
Cache.NamedKey
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_PREFIX_LENGTH
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidclose(String namespace)static MemcachedCachecreate(MemcachedCacheConfig config)static net.spy.memcached.ConnectionFactorycreateConnectionFactory(MemcachedCacheConfig config, LZ4Transcoder transcoder, net.spy.memcached.ops.OperationQueueFactory opQueueFactory, net.spy.memcached.metrics.MetricCollector metricCollector)voiddoMonitor(org.apache.druid.java.util.emitter.service.ServiceEmitter emitter)Custom metrics not covered by CacheStats may be emitted by this method.byte[]get(Cache.NamedKey key)Map<Cache.NamedKey,byte[]>getBulk(Iterable<Cache.NamedKey> keys)Resulting map should not contain any null values (i.e.CacheStatsgetStats()booleanisLocal()voidput(Cache.NamedKey key, byte[] value)
-
-
-
Field Detail
-
MAX_PREFIX_LENGTH
public static final int MAX_PREFIX_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static MemcachedCache create(MemcachedCacheConfig config)
-
createConnectionFactory
public static net.spy.memcached.ConnectionFactory createConnectionFactory(MemcachedCacheConfig config, LZ4Transcoder transcoder, net.spy.memcached.ops.OperationQueueFactory opQueueFactory, net.spy.memcached.metrics.MetricCollector metricCollector) throws KeyManagementException, KeyStoreException, NoSuchAlgorithmException
-
getStats
public CacheStats getStats()
-
get
public byte[] get(Cache.NamedKey key)
-
put
public void put(Cache.NamedKey key, byte[] value)
-
getBulk
public Map<Cache.NamedKey,byte[]> getBulk(Iterable<Cache.NamedKey> keys)
Description copied from interface:CacheResulting map should not contain any null values (i.e. cache misses should not be included)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
doMonitor
public void doMonitor(org.apache.druid.java.util.emitter.service.ServiceEmitter emitter)
Description copied from interface:CacheCustom metrics not covered by CacheStats may be emitted by this method.
-
-