org.apache.cassandra.service
Class CacheService

java.lang.Object
  extended by org.apache.cassandra.service.CacheService
All Implemented Interfaces:
CacheServiceMBean

public class CacheService
extends java.lang.Object
implements CacheServiceMBean


Nested Class Summary
static class CacheService.CacheType
           
 
Field Summary
static int AVERAGE_KEY_CACHE_ROW_SIZE
           
static CacheService instance
           
 AutoSavingCache<KeyCacheKey,java.lang.Long> keyCache
           
static java.lang.String MBEAN_NAME
           
 AutoSavingCache<RowCacheKey,IRowCacheEntry> rowCache
           
 
Method Summary
 long getKeyCacheCapacityInBytes()
           
 long getKeyCacheCapacityInMB()
           
 long getKeyCacheHits()
           
 double getKeyCacheRecentHitRate()
           
 long getKeyCacheRequests()
           
 int getKeyCacheSavePeriodInSeconds()
           
 long getKeyCacheSize()
           
 long getRowCacheCapacityInBytes()
           
 long getRowCacheCapacityInMB()
           
 long getRowCacheHits()
           
 double getRowCacheRecentHitRate()
           
 long getRowCacheRequests()
           
 int getRowCacheSavePeriodInSeconds()
           
 long getRowCacheSize()
           
 void invalidateKeyCache()
          invalidate the key cache; for use after invalidating row cache
 void invalidateRowCache()
          invalidate the row cache; for use after bulk loading via BinaryMemtable
 void reduceCacheSizes()
          sets each cache's maximum capacity to "reduce_cache_capacity_to" of its current size
 void reduceKeyCacheSize()
           
 void reduceRowCacheSize()
           
 void saveCaches()
          save row and key caches
 void setKeyCacheCapacityInMB(long capacity)
           
 void setKeyCacheSavePeriodInSeconds(int kcspis)
           
 void setRowCacheCapacityInMB(long capacity)
           
 void setRowCacheSavePeriodInSeconds(int rcspis)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MBEAN_NAME

public static final java.lang.String MBEAN_NAME
See Also:
Constant Field Values

AVERAGE_KEY_CACHE_ROW_SIZE

public static final int AVERAGE_KEY_CACHE_ROW_SIZE
See Also:
Constant Field Values

instance

public static final CacheService instance

keyCache

public final AutoSavingCache<KeyCacheKey,java.lang.Long> keyCache

rowCache

public final AutoSavingCache<RowCacheKey,IRowCacheEntry> rowCache
Method Detail

getKeyCacheHits

public long getKeyCacheHits()
Specified by:
getKeyCacheHits in interface CacheServiceMBean

getRowCacheHits

public long getRowCacheHits()
Specified by:
getRowCacheHits in interface CacheServiceMBean

getKeyCacheRequests

public long getKeyCacheRequests()
Specified by:
getKeyCacheRequests in interface CacheServiceMBean

getRowCacheRequests

public long getRowCacheRequests()
Specified by:
getRowCacheRequests in interface CacheServiceMBean

getKeyCacheRecentHitRate

public double getKeyCacheRecentHitRate()
Specified by:
getKeyCacheRecentHitRate in interface CacheServiceMBean

getRowCacheRecentHitRate

public double getRowCacheRecentHitRate()
Specified by:
getRowCacheRecentHitRate in interface CacheServiceMBean

getRowCacheSavePeriodInSeconds

public int getRowCacheSavePeriodInSeconds()
Specified by:
getRowCacheSavePeriodInSeconds in interface CacheServiceMBean

setRowCacheSavePeriodInSeconds

public void setRowCacheSavePeriodInSeconds(int rcspis)
Specified by:
setRowCacheSavePeriodInSeconds in interface CacheServiceMBean

getKeyCacheSavePeriodInSeconds

public int getKeyCacheSavePeriodInSeconds()
Specified by:
getKeyCacheSavePeriodInSeconds in interface CacheServiceMBean

setKeyCacheSavePeriodInSeconds

public void setKeyCacheSavePeriodInSeconds(int kcspis)
Specified by:
setKeyCacheSavePeriodInSeconds in interface CacheServiceMBean

invalidateKeyCache

public void invalidateKeyCache()
Description copied from interface: CacheServiceMBean
invalidate the key cache; for use after invalidating row cache

Specified by:
invalidateKeyCache in interface CacheServiceMBean

invalidateRowCache

public void invalidateRowCache()
Description copied from interface: CacheServiceMBean
invalidate the row cache; for use after bulk loading via BinaryMemtable

Specified by:
invalidateRowCache in interface CacheServiceMBean

getRowCacheCapacityInBytes

public long getRowCacheCapacityInBytes()
Specified by:
getRowCacheCapacityInBytes in interface CacheServiceMBean

getRowCacheCapacityInMB

public long getRowCacheCapacityInMB()
Specified by:
getRowCacheCapacityInMB in interface CacheServiceMBean

setRowCacheCapacityInMB

public void setRowCacheCapacityInMB(long capacity)
Specified by:
setRowCacheCapacityInMB in interface CacheServiceMBean

getKeyCacheCapacityInBytes

public long getKeyCacheCapacityInBytes()
Specified by:
getKeyCacheCapacityInBytes in interface CacheServiceMBean

getKeyCacheCapacityInMB

public long getKeyCacheCapacityInMB()
Specified by:
getKeyCacheCapacityInMB in interface CacheServiceMBean

setKeyCacheCapacityInMB

public void setKeyCacheCapacityInMB(long capacity)
Specified by:
setKeyCacheCapacityInMB in interface CacheServiceMBean

getRowCacheSize

public long getRowCacheSize()
Specified by:
getRowCacheSize in interface CacheServiceMBean

getKeyCacheSize

public long getKeyCacheSize()
Specified by:
getKeyCacheSize in interface CacheServiceMBean

reduceCacheSizes

public void reduceCacheSizes()
Description copied from interface: CacheServiceMBean
sets each cache's maximum capacity to "reduce_cache_capacity_to" of its current size

Specified by:
reduceCacheSizes in interface CacheServiceMBean

reduceRowCacheSize

public void reduceRowCacheSize()

reduceKeyCacheSize

public void reduceKeyCacheSize()

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 interface CacheServiceMBean
Throws:
java.util.concurrent.ExecutionException - when attempting to retrieve the result of a task that aborted by throwing an exception
java.lang.InterruptedException - when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.


Copyright © 2012 The Apache Software Foundation