Package org.apache.cassandra.cache
Class ChunkCache
- java.lang.Object
-
- org.apache.cassandra.cache.ChunkCache
-
- All Implemented Interfaces:
com.github.benmanes.caffeine.cache.AsyncCacheLoader<org.apache.cassandra.cache.ChunkCache.Key,org.apache.cassandra.cache.ChunkCache.Buffer>
,com.github.benmanes.caffeine.cache.CacheLoader<org.apache.cassandra.cache.ChunkCache.Key,org.apache.cassandra.cache.ChunkCache.Buffer>
,com.github.benmanes.caffeine.cache.RemovalListener<org.apache.cassandra.cache.ChunkCache.Key,org.apache.cassandra.cache.ChunkCache.Buffer>
,CacheSize
public class ChunkCache extends java.lang.Object implements com.github.benmanes.caffeine.cache.CacheLoader<org.apache.cassandra.cache.ChunkCache.Key,org.apache.cassandra.cache.ChunkCache.Buffer>, com.github.benmanes.caffeine.cache.RemovalListener<org.apache.cassandra.cache.ChunkCache.Key,org.apache.cassandra.cache.ChunkCache.Buffer>, CacheSize
-
-
Field Summary
Fields Modifier and Type Field Description static long
cacheSize
static ChunkCache
instance
ChunkCacheMetrics
metrics
static int
RESERVED_POOL_SPACE_IN_MiB
static boolean
roundUp
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
capacity()
void
close()
void
invalidateFile(java.lang.String fileName)
void
invalidatePosition(FileHandle dfile, long position)
org.apache.cassandra.cache.ChunkCache.Buffer
load(org.apache.cassandra.cache.ChunkCache.Key key)
static RebuffererFactory
maybeWrap(ChunkReader file)
void
onRemoval(org.apache.cassandra.cache.ChunkCache.Key key, org.apache.cassandra.cache.ChunkCache.Buffer buffer, com.github.benmanes.caffeine.cache.RemovalCause cause)
void
setCapacity(long capacity)
int
size()
long
weightedSize()
RebuffererFactory
wrap(ChunkReader file)
-
-
-
Field Detail
-
RESERVED_POOL_SPACE_IN_MiB
public static final int RESERVED_POOL_SPACE_IN_MiB
- See Also:
- Constant Field Values
-
cacheSize
public static final long cacheSize
-
roundUp
public static final boolean roundUp
-
instance
public static final ChunkCache instance
-
metrics
public final ChunkCacheMetrics metrics
-
-
Method Detail
-
load
public org.apache.cassandra.cache.ChunkCache.Buffer load(org.apache.cassandra.cache.ChunkCache.Key key)
- Specified by:
load
in interfacecom.github.benmanes.caffeine.cache.CacheLoader<org.apache.cassandra.cache.ChunkCache.Key,org.apache.cassandra.cache.ChunkCache.Buffer>
-
onRemoval
public void onRemoval(org.apache.cassandra.cache.ChunkCache.Key key, org.apache.cassandra.cache.ChunkCache.Buffer buffer, com.github.benmanes.caffeine.cache.RemovalCause cause)
- Specified by:
onRemoval
in interfacecom.github.benmanes.caffeine.cache.RemovalListener<org.apache.cassandra.cache.ChunkCache.Key,org.apache.cassandra.cache.ChunkCache.Buffer>
-
close
public void close()
-
wrap
public RebuffererFactory wrap(ChunkReader file)
-
maybeWrap
public static RebuffererFactory maybeWrap(ChunkReader file)
-
invalidatePosition
public void invalidatePosition(FileHandle dfile, long position)
-
invalidateFile
public void invalidateFile(java.lang.String fileName)
-
setCapacity
public void setCapacity(long capacity)
- Specified by:
setCapacity
in interfaceCacheSize
-
weightedSize
public long weightedSize()
- Specified by:
weightedSize
in interfaceCacheSize
-
-