Package org.apache.cassandra.service
Class CacheService
- java.lang.Object
-
- org.apache.cassandra.service.CacheService
-
- All Implemented Interfaces:
CacheServiceMBean
public class CacheService extends java.lang.Object implements CacheServiceMBean
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CacheService.CacheType
static class
CacheService.CounterCacheSerializer
static class
CacheService.KeyCacheSerializer
static class
CacheService.RowCacheSerializer
-
Field Summary
Fields Modifier and Type Field Description AutoSavingCache<CounterCacheKey,ClockAndCount>
counterCache
static CacheService
instance
AutoSavingCache<KeyCacheKey,AbstractRowIndexEntry>
keyCache
static java.lang.String
MBEAN_NAME
AutoSavingCache<RowCacheKey,IRowCacheEntry>
rowCache
-
Method Summary
-
-
-
Field Detail
-
MBEAN_NAME
public static final java.lang.String MBEAN_NAME
- See Also:
- Constant Field Values
-
instance
public static final CacheService instance
-
keyCache
public final AutoSavingCache<KeyCacheKey,AbstractRowIndexEntry> keyCache
-
rowCache
public final AutoSavingCache<RowCacheKey,IRowCacheEntry> rowCache
-
counterCache
public final AutoSavingCache<CounterCacheKey,ClockAndCount> counterCache
-
-
Method Detail
-
getRowCacheSavePeriodInSeconds
public int getRowCacheSavePeriodInSeconds()
- Specified by:
getRowCacheSavePeriodInSeconds
in interfaceCacheServiceMBean
-
setRowCacheSavePeriodInSeconds
public void setRowCacheSavePeriodInSeconds(int seconds)
- Specified by:
setRowCacheSavePeriodInSeconds
in interfaceCacheServiceMBean
-
getKeyCacheSavePeriodInSeconds
public int getKeyCacheSavePeriodInSeconds()
- Specified by:
getKeyCacheSavePeriodInSeconds
in interfaceCacheServiceMBean
-
setKeyCacheSavePeriodInSeconds
public void setKeyCacheSavePeriodInSeconds(int seconds)
- Specified by:
setKeyCacheSavePeriodInSeconds
in interfaceCacheServiceMBean
-
getCounterCacheSavePeriodInSeconds
public int getCounterCacheSavePeriodInSeconds()
- Specified by:
getCounterCacheSavePeriodInSeconds
in interfaceCacheServiceMBean
-
setCounterCacheSavePeriodInSeconds
public void setCounterCacheSavePeriodInSeconds(int seconds)
- Specified by:
setCounterCacheSavePeriodInSeconds
in interfaceCacheServiceMBean
-
getRowCacheKeysToSave
public int getRowCacheKeysToSave()
- Specified by:
getRowCacheKeysToSave
in interfaceCacheServiceMBean
-
setRowCacheKeysToSave
public void setRowCacheKeysToSave(int count)
- Specified by:
setRowCacheKeysToSave
in interfaceCacheServiceMBean
-
getKeyCacheKeysToSave
public int getKeyCacheKeysToSave()
- Specified by:
getKeyCacheKeysToSave
in interfaceCacheServiceMBean
-
setKeyCacheKeysToSave
public void setKeyCacheKeysToSave(int count)
- Specified by:
setKeyCacheKeysToSave
in interfaceCacheServiceMBean
-
getCounterCacheKeysToSave
public int getCounterCacheKeysToSave()
- Specified by:
getCounterCacheKeysToSave
in interfaceCacheServiceMBean
-
setCounterCacheKeysToSave
public void setCounterCacheKeysToSave(int count)
- Specified by:
setCounterCacheKeysToSave
in interfaceCacheServiceMBean
-
invalidateKeyCache
public void invalidateKeyCache()
Description copied from interface:CacheServiceMBean
invalidate the key cache; for use after invalidating row cache- Specified by:
invalidateKeyCache
in interfaceCacheServiceMBean
-
invalidateKeyCacheForCf
public void invalidateKeyCacheForCf(TableMetadata tableMetadata)
-
invalidateRowCache
public void invalidateRowCache()
Description copied from interface:CacheServiceMBean
invalidate the row cache; for use after bulk loading via BinaryMemtable- Specified by:
invalidateRowCache
in interfaceCacheServiceMBean
-
invalidateRowCacheForCf
public void invalidateRowCacheForCf(TableMetadata tableMetadata)
-
invalidateCounterCacheForCf
public void invalidateCounterCacheForCf(TableMetadata tableMetadata)
-
invalidateCounterCache
public void invalidateCounterCache()
- Specified by:
invalidateCounterCache
in interfaceCacheServiceMBean
-
setRowCacheCapacityInMB
public void setRowCacheCapacityInMB(long capacity)
- Specified by:
setRowCacheCapacityInMB
in interfaceCacheServiceMBean
-
setKeyCacheCapacityInMB
public void setKeyCacheCapacityInMB(long capacity)
- Specified by:
setKeyCacheCapacityInMB
in interfaceCacheServiceMBean
-
setCounterCacheCapacityInMB
public void setCounterCacheCapacityInMB(long capacity)
- Specified by:
setCounterCacheCapacityInMB
in interfaceCacheServiceMBean
-
saveCaches
public void saveCaches() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Description copied from interface:CacheServiceMBean
save row and key caches- Specified by:
saveCaches
in interfaceCacheServiceMBean
- Throws:
java.util.concurrent.ExecutionException
- when attempting to retrieve the result of a task that aborted by throwing an exceptionjava.lang.InterruptedException
- when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.
-
-