public class CacheService extends java.lang.Object implements CacheServiceMBean
Modifier and Type | Class and Description |
---|---|
static class |
CacheService.CacheType |
static class |
CacheService.CounterCacheSerializer |
static class |
CacheService.KeyCacheSerializer |
static class |
CacheService.RowCacheSerializer |
Modifier and Type | Field and Description |
---|---|
AutoSavingCache<CounterCacheKey,ClockAndCount> |
counterCache |
static CacheService |
instance |
AutoSavingCache<KeyCacheKey,RowIndexEntry> |
keyCache |
static java.lang.String |
MBEAN_NAME |
AutoSavingCache<RowCacheKey,IRowCacheEntry> |
rowCache |
Modifier and Type | Method and Description |
---|---|
int |
getCounterCacheKeysToSave() |
int |
getCounterCacheSavePeriodInSeconds() |
int |
getKeyCacheKeysToSave() |
int |
getKeyCacheSavePeriodInSeconds() |
int |
getRowCacheKeysToSave() |
int |
getRowCacheSavePeriodInSeconds() |
void |
invalidateCounterCache() |
void |
invalidateCounterCacheForCf(Pair<java.lang.String,java.lang.String> ksAndCFName) |
void |
invalidateKeyCache()
invalidate the key cache; for use after invalidating row cache
|
void |
invalidateKeyCacheForCf(Pair<java.lang.String,java.lang.String> ksAndCFName) |
void |
invalidateRowCache()
invalidate the row cache; for use after bulk loading via BinaryMemtable
|
void |
invalidateRowCacheForCf(Pair<java.lang.String,java.lang.String> ksAndCFName) |
void |
saveCaches()
save row and key caches
|
void |
setCounterCacheCapacityInMB(long capacity) |
void |
setCounterCacheKeysToSave(int count) |
void |
setCounterCacheSavePeriodInSeconds(int seconds) |
void |
setKeyCacheCapacityInMB(long capacity) |
void |
setKeyCacheKeysToSave(int count) |
void |
setKeyCacheSavePeriodInSeconds(int seconds) |
void |
setRowCacheCapacityInMB(long capacity) |
void |
setRowCacheKeysToSave(int count) |
void |
setRowCacheSavePeriodInSeconds(int seconds) |
public static final java.lang.String MBEAN_NAME
public static final CacheService instance
public final AutoSavingCache<KeyCacheKey,RowIndexEntry> keyCache
public final AutoSavingCache<RowCacheKey,IRowCacheEntry> rowCache
public final AutoSavingCache<CounterCacheKey,ClockAndCount> counterCache
public int getRowCacheSavePeriodInSeconds()
getRowCacheSavePeriodInSeconds
in interface CacheServiceMBean
public void setRowCacheSavePeriodInSeconds(int seconds)
setRowCacheSavePeriodInSeconds
in interface CacheServiceMBean
public int getKeyCacheSavePeriodInSeconds()
getKeyCacheSavePeriodInSeconds
in interface CacheServiceMBean
public void setKeyCacheSavePeriodInSeconds(int seconds)
setKeyCacheSavePeriodInSeconds
in interface CacheServiceMBean
public int getCounterCacheSavePeriodInSeconds()
getCounterCacheSavePeriodInSeconds
in interface CacheServiceMBean
public void setCounterCacheSavePeriodInSeconds(int seconds)
setCounterCacheSavePeriodInSeconds
in interface CacheServiceMBean
public int getRowCacheKeysToSave()
getRowCacheKeysToSave
in interface CacheServiceMBean
public void setRowCacheKeysToSave(int count)
setRowCacheKeysToSave
in interface CacheServiceMBean
public int getKeyCacheKeysToSave()
getKeyCacheKeysToSave
in interface CacheServiceMBean
public void setKeyCacheKeysToSave(int count)
setKeyCacheKeysToSave
in interface CacheServiceMBean
public int getCounterCacheKeysToSave()
getCounterCacheKeysToSave
in interface CacheServiceMBean
public void setCounterCacheKeysToSave(int count)
setCounterCacheKeysToSave
in interface CacheServiceMBean
public void invalidateKeyCache()
CacheServiceMBean
invalidateKeyCache
in interface CacheServiceMBean
public void invalidateKeyCacheForCf(Pair<java.lang.String,java.lang.String> ksAndCFName)
public void invalidateRowCache()
CacheServiceMBean
invalidateRowCache
in interface CacheServiceMBean
public void invalidateRowCacheForCf(Pair<java.lang.String,java.lang.String> ksAndCFName)
public void invalidateCounterCacheForCf(Pair<java.lang.String,java.lang.String> ksAndCFName)
public void invalidateCounterCache()
invalidateCounterCache
in interface CacheServiceMBean
public void setRowCacheCapacityInMB(long capacity)
setRowCacheCapacityInMB
in interface CacheServiceMBean
public void setKeyCacheCapacityInMB(long capacity)
setKeyCacheCapacityInMB
in interface CacheServiceMBean
public void setCounterCacheCapacityInMB(long capacity)
setCounterCacheCapacityInMB
in interface CacheServiceMBean
public void saveCaches() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
CacheServiceMBean
saveCaches
in interface CacheServiceMBean
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.Copyright © 2015 The Apache Software Foundation