public class AutoSavingCache<K extends CacheKey,V> extends InstrumentingCache<K,V>
Modifier and Type | Class and Description |
---|---|
static interface |
AutoSavingCache.CacheSerializer<K extends CacheKey,V> |
static interface |
AutoSavingCache.IStreamFactory |
class |
AutoSavingCache.Writer |
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
AutoSavingCache(ICache<K,V> cache,
CacheService.CacheType cacheType,
AutoSavingCache.CacheSerializer<K,V> cacheloader) |
Modifier and Type | Method and Description |
---|---|
java.io.File |
getCacheCrcPath(java.util.UUID cfId,
java.lang.String version) |
java.io.File |
getCacheDataPath(java.util.UUID cfId,
java.lang.String version) |
AutoSavingCache.Writer |
getWriter(int keysToSave) |
int |
loadSaved(ColumnFamilyStore cfs) |
void |
scheduleSaving(int savePeriodInSeconds,
int keysToSave) |
static void |
setStreamFactory(AutoSavingCache.IStreamFactory streamFactory) |
java.util.concurrent.Future<?> |
submitWrite(int keysToSave) |
clear, containsKey, get, getCapacity, getInternal, getMetrics, hotKeyIterator, keyIterator, put, putIfAbsent, remove, replace, setCapacity, size, weightedSize
public static final java.util.Set<CacheService.CacheType> flushInProgress
protected volatile java.util.concurrent.ScheduledFuture<?> saveTask
protected final CacheService.CacheType cacheType
public AutoSavingCache(ICache<K,V> cache, CacheService.CacheType cacheType, AutoSavingCache.CacheSerializer<K,V> cacheloader)
public static void setStreamFactory(AutoSavingCache.IStreamFactory streamFactory)
public java.io.File getCacheDataPath(java.util.UUID cfId, java.lang.String version)
public java.io.File getCacheCrcPath(java.util.UUID cfId, java.lang.String version)
public AutoSavingCache.Writer getWriter(int keysToSave)
public void scheduleSaving(int savePeriodInSeconds, int keysToSave)
public int loadSaved(ColumnFamilyStore cfs)
public java.util.concurrent.Future<?> submitWrite(int keysToSave)
Copyright © 2015 The Apache Software Foundation