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
           
 class CacheService.KeyCacheSerializer
           
 class CacheService.RowCacheSerializer
           
 
Field Summary
static CacheService instance
           
 AutoSavingCache<KeyCacheKey,RowIndexEntry> keyCache
           
static java.lang.String MBEAN_NAME
           
 AutoSavingCache<RowCacheKey,IRowCacheEntry> rowCache
           
 
Method Summary
 long getKeyCacheCapacityInBytes()
           
 long getKeyCacheCapacityInMB()
           
 long getKeyCacheEntries()
           
 long getKeyCacheHits()
           
 double getKeyCacheRecentHitRate()
           
 long getKeyCacheRequests()
           
 int getKeyCacheSavePeriodInSeconds()
           
 long getKeyCacheSize()
           
 long getRowCacheCapacityInBytes()
           
 long getRowCacheCapacityInMB()
           
 long getRowCacheEntries()
           
 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

instance

public static final CacheService instance

keyCache

public final AutoSavingCache<KeyCacheKey,RowIndexEntry> keyCache

rowCache

public final AutoSavingCache<RowCacheKey,IRowCacheEntry> rowCache
Method Detail

getKeyCacheHits

public long getKeyCacheHits()
Specified by:
getKeyCacheHits in interface CacheServiceMBean
See Also:
CacheMetrics.hits

getRowCacheHits

public long getRowCacheHits()
Specified by:
getRowCacheHits in interface CacheServiceMBean
See Also:
CacheMetrics.hits

getKeyCacheRequests

public long getKeyCacheRequests()
Specified by:
getKeyCacheRequests in interface CacheServiceMBean
See Also:
CacheMetrics.requests

getRowCacheRequests

public long getRowCacheRequests()
Specified by:
getRowCacheRequests in interface CacheServiceMBean
See Also:
CacheMetrics.requests

getKeyCacheRecentHitRate

public double getKeyCacheRecentHitRate()
Specified by:
getKeyCacheRecentHitRate in interface CacheServiceMBean
See Also:
CacheMetrics.hitRate

getRowCacheRecentHitRate

public double getRowCacheRecentHitRate()
Specified by:
getRowCacheRecentHitRate in interface CacheServiceMBean
See Also:
CacheMetrics.hitRate

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
See Also:
CacheMetrics.capacity

getRowCacheCapacityInMB

public long getRowCacheCapacityInMB()
Specified by:
getRowCacheCapacityInMB in interface CacheServiceMBean
See Also:
CacheMetrics.capacity

setRowCacheCapacityInMB

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

getKeyCacheCapacityInBytes

public long getKeyCacheCapacityInBytes()
Specified by:
getKeyCacheCapacityInBytes in interface CacheServiceMBean
See Also:
CacheMetrics.capacity

getKeyCacheCapacityInMB

public long getKeyCacheCapacityInMB()
Specified by:
getKeyCacheCapacityInMB in interface CacheServiceMBean
See Also:
CacheMetrics.capacity

setKeyCacheCapacityInMB

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

getRowCacheSize

public long getRowCacheSize()
Specified by:
getRowCacheSize in interface CacheServiceMBean
See Also:
CacheMetrics.size

getRowCacheEntries

public long getRowCacheEntries()
Specified by:
getRowCacheEntries in interface CacheServiceMBean
See Also:
CacheMetrics.entries

getKeyCacheSize

public long getKeyCacheSize()
Specified by:
getKeyCacheSize in interface CacheServiceMBean
See Also:
CacheMetrics.size

getKeyCacheEntries

public long getKeyCacheEntries()
Specified by:
getKeyCacheEntries in interface CacheServiceMBean
See Also:
CacheMetrics.entries

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