Package org.apache.cassandra.cache
Class AutoSavingCache<K extends CacheKey,V>
java.lang.Object
org.apache.cassandra.cache.InstrumentingCache<K,V>
org.apache.cassandra.cache.AutoSavingCache<K,V>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAutoSavingCache.CacheSerializer<K extends CacheKey,V> A base cache serializer that is used to serialize/deserialize a cache to/from disk.static interfaceclass -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CacheService.CacheTypestatic final Set<CacheService.CacheType>True if a cache flush is currently executing: only one may execute at a time.protected ScheduledFuture<?> -
Constructor Summary
ConstructorsConstructorDescriptionAutoSavingCache(ICache<K, V> cache, CacheService.CacheType cacheType, AutoSavingCache.CacheSerializer<K, V> cacheloader) -
Method Summary
Modifier and TypeMethodDescriptiongetCacheCrcPath(String version) getCacheDataPath(String version) getCacheMetadataPath(String version) getWriter(int keysToSave) intvoidscheduleSaving(int savePeriodInSeconds, int keysToSave) static voidsetStreamFactory(AutoSavingCache.IStreamFactory streamFactory) Future<?>submitWrite(int keysToSave) Methods inherited from class org.apache.cassandra.cache.InstrumentingCache
clear, containsKey, get, getCapacity, getInternal, getMetrics, hotKeyIterator, keyIterator, put, putIfAbsent, remove, replace, setCapacity, size, weightedSize
-
Field Details
-
flushInProgress
True if a cache flush is currently executing: only one may execute at a time. -
saveTask
-
cacheType
-
-
Constructor Details
-
AutoSavingCache
public AutoSavingCache(ICache<K, V> cache, CacheService.CacheType cacheType, AutoSavingCache.CacheSerializer<K, V> cacheloader)
-
-
Method Details
-
setStreamFactory
-
getCacheDataPath
-
getCacheCrcPath
-
getCacheMetadataPath
-
getWriter
-
scheduleSaving
public void scheduleSaving(int savePeriodInSeconds, int keysToSave) -
loadSavedAsync
-
loadSaved
public int loadSaved() -
submitWrite
-