org.apache.cassandra.cache
Class AutoSavingCache<K,V>
java.lang.Object
org.apache.cassandra.cache.InstrumentingCache<K,V>
org.apache.cassandra.cache.AutoSavingCache<K,V>
- All Implemented Interfaces:
- InstrumentingCacheMBean
- Direct Known Subclasses:
- AutoSavingKeyCache, AutoSavingRowCache
public abstract class AutoSavingCache<K,V>
- extends InstrumentingCache<K,V>
Methods inherited from class org.apache.cassandra.cache.InstrumentingCache |
clear, get, getCapacity, getHits, getInternal, getKeySet, getRecentHitRate, getRequests, getSize, hotKeySet, isCapacitySetManually, isPutCopying, put, remove, setCapacity, size, updateCapacity |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
flushInProgress
public static final java.util.concurrent.atomic.AtomicBoolean flushInProgress
- True if a cache flush is currently executing: only one may execute at a time.
cfName
protected final java.lang.String cfName
tableName
protected final java.lang.String tableName
saveTask
protected volatile java.util.concurrent.ScheduledFuture<?> saveTask
cacheType
protected final ColumnFamilyStore.CacheType cacheType
AutoSavingCache
public AutoSavingCache(ICache<K,V> cache,
java.lang.String tableName,
java.lang.String cfName,
ColumnFamilyStore.CacheType cacheType)
translateKey
public abstract java.nio.ByteBuffer translateKey(K key)
getConfiguredCacheSize
public abstract double getConfiguredCacheSize(CFMetaData cfm)
getAdjustedCacheSize
public int getAdjustedCacheSize(long expectedKeys)
getCachePath
public java.io.File getCachePath()
getWriter
public AutoSavingCache.Writer getWriter(int keysToSave)
scheduleSaving
public void scheduleSaving(int savePeriodInSeconds,
int keysToSave)
submitWrite
public java.util.concurrent.Future<?> submitWrite(int keysToSave)
readSaved
public java.util.Set<DecoratedKey> readSaved()
updateCacheSize
public void updateCacheSize(long keys)
- Resizes the cache based on a key estimate.
Caller is in charge of synchronizing this correctly if needed
reduceCacheSize
public void reduceCacheSize()
Copyright © 2011 The Apache Software Foundation