Class MapCache

java.lang.Object
org.apache.druid.client.cache.MapCache
All Implemented Interfaces:
Closeable, AutoCloseable, Cache

public class MapCache extends Object implements Cache
  • Method Details

    • create

      public static Cache create(long sizeInBytes)
    • getStats

      public CacheStats getStats()
      Specified by:
      getStats in interface Cache
    • get

      public byte[] get(Cache.NamedKey key)
      Specified by:
      get in interface Cache
    • put

      public void put(Cache.NamedKey key, byte[] value)
      Specified by:
      put in interface Cache
    • getBulk

      public Map<Cache.NamedKey,byte[]> getBulk(Iterable<Cache.NamedKey> keys)
      Description copied from interface: Cache
      Resulting map should not contain any null values (i.e. cache misses should not be included)
      Specified by:
      getBulk in interface Cache
      Returns:
    • close

      public void close(String namespace)
      Specified by:
      close in interface Cache
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • isLocal

      public boolean isLocal()
      Specified by:
      isLocal in interface Cache
    • doMonitor

      public void doMonitor(ServiceEmitter emitter)
      Description copied from interface: Cache
      Custom metrics not covered by CacheStats may be emitted by this method.
      Specified by:
      doMonitor in interface Cache
      Parameters:
      emitter - The service emitter to emit on.