org.apache.cassandra.cache
Class AutoSavingCache<K extends CacheKey,V>

java.lang.Object
  extended by org.apache.cassandra.cache.InstrumentingCache<K,V>
      extended by org.apache.cassandra.cache.AutoSavingCache<K,V>

public class AutoSavingCache<K extends CacheKey,V>
extends InstrumentingCache<K,V>


Nested Class Summary
static interface AutoSavingCache.CacheSerializer<K extends CacheKey,V>
           
 class AutoSavingCache.Writer
           
 
Field Summary
protected  CacheService.CacheType cacheType
           
static java.util.Set<CacheService.CacheType> flushInProgress
          True if a cache flush is currently executing: only one may execute at a time.
protected  java.util.concurrent.ScheduledFuture<?> saveTask
           
 
Constructor Summary
AutoSavingCache(ICache<K,V> cache, CacheService.CacheType cacheType, AutoSavingCache.CacheSerializer<K,V> cacheloader)
           
 
Method Summary
 java.io.File getCachePath(java.lang.String ksName, java.lang.String cfName, java.lang.String version)
           
 AutoSavingCache.Writer getWriter(int keysToSave)
           
 int loadSaved(ColumnFamilyStore cfs)
           
 void reduceCacheSize()
           
 void scheduleSaving(int savePeriodInSeconds, int keysToSave)
           
 java.util.concurrent.Future<?> submitWrite(int keysToSave)
           
 
Methods inherited from class org.apache.cassandra.cache.InstrumentingCache
clear, containsKey, get, getCapacity, getInternal, getKeySet, getMetrics, hotKeySet, isCapacitySetManually, isPutCopying, put, putIfAbsent, remove, replace, setCapacity, size, updateCapacity, weightedSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flushInProgress

public static final java.util.Set<CacheService.CacheType> flushInProgress
True if a cache flush is currently executing: only one may execute at a time.


saveTask

protected volatile java.util.concurrent.ScheduledFuture<?> saveTask

cacheType

protected final CacheService.CacheType cacheType
Constructor Detail

AutoSavingCache

public AutoSavingCache(ICache<K,V> cache,
                       CacheService.CacheType cacheType,
                       AutoSavingCache.CacheSerializer<K,V> cacheloader)
Method Detail

getCachePath

public java.io.File getCachePath(java.lang.String ksName,
                                 java.lang.String cfName,
                                 java.lang.String version)

getWriter

public AutoSavingCache.Writer getWriter(int keysToSave)

scheduleSaving

public void scheduleSaving(int savePeriodInSeconds,
                           int keysToSave)

loadSaved

public int loadSaved(ColumnFamilyStore cfs)

submitWrite

public java.util.concurrent.Future<?> submitWrite(int keysToSave)

reduceCacheSize

public void reduceCacheSize()


Copyright © 2013 The Apache Software Foundation