CacheService (apache-cassandra API)
Date: 2014-10-21

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 and Description
    --- | ---
    `static class` | `CacheService.CacheType`
    `static class` | `CacheService.CounterCacheSerializer`
    `static class` | `CacheService.KeyCacheSerializer`
    `static class` | `CacheService.RowCacheSerializer`

  - ### Field Summary

    Fields
    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`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getCounterCacheKeysToSave()`
    `int` | `getCounterCacheSavePeriodInSeconds()`
    `long` | `getKeyCacheCapacityInBytes()`
    `long` | `getKeyCacheCapacityInMB()`
    `long` | `getKeyCacheEntries()`
    `long` | `getKeyCacheHits()`
    `int` | `getKeyCacheKeysToSave()`
    `double` | `getKeyCacheRecentHitRate()`
    `long` | `getKeyCacheRequests()`
    `int` | `getKeyCacheSavePeriodInSeconds()`
    `long` | `getKeyCacheSize()`
    `long` | `getRowCacheCapacityInBytes()`
    `long` | `getRowCacheCapacityInMB()`
    `long` | `getRowCacheEntries()`
    `long` | `getRowCacheHits()`
    `int` | `getRowCacheKeysToSave()`
    `double` | `getRowCacheRecentHitRate()`
    `long` | `getRowCacheRequests()`
    `int` | `getRowCacheSavePeriodInSeconds()`
    `long` | `getRowCacheSize()`
    `void` | `invalidateCounterCache()`
    `void` | `invalidateCounterCacheForCf(java.util.UUID cfId)`
    `void` | `invalidateKeyCache()` invalidate the key cache; for use after invalidating row cache
    `void` | `invalidateKeyCacheForCf(java.util.UUID cfId)`
    `void` | `invalidateRowCache()` invalidate the row cache; for use after bulk loading via BinaryMemtable
    `void` | `invalidateRowCacheForCf(java.util.UUID cfId)`
    `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)`

    - ### 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

    - #### counterCache

          public final AutoSavingCache<CounterCacheKey,ClockAndCount> counterCache

  - ### 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 seconds)

      Specified by:
        `setRowCacheSavePeriodInSeconds` in interface `CacheServiceMBean`

    - #### getKeyCacheSavePeriodInSeconds

          public int getKeyCacheSavePeriodInSeconds()

      Specified by:
        `getKeyCacheSavePeriodInSeconds` in interface `CacheServiceMBean`

    - #### setKeyCacheSavePeriodInSeconds

          public void setKeyCacheSavePeriodInSeconds(int seconds)

      Specified by:
        `setKeyCacheSavePeriodInSeconds` in interface `CacheServiceMBean`

    - #### getCounterCacheSavePeriodInSeconds

          public int getCounterCacheSavePeriodInSeconds()

      Specified by:
        `getCounterCacheSavePeriodInSeconds` in interface `CacheServiceMBean`

    - #### setCounterCacheSavePeriodInSeconds

          public void setCounterCacheSavePeriodInSeconds(int seconds)

      Specified by:
        `setCounterCacheSavePeriodInSeconds` in interface `CacheServiceMBean`

    - #### getRowCacheKeysToSave

          public int getRowCacheKeysToSave()

      Specified by:
        `getRowCacheKeysToSave` in interface `CacheServiceMBean`

    - #### setRowCacheKeysToSave

          public void setRowCacheKeysToSave(int count)

      Specified by:
        `setRowCacheKeysToSave` in interface `CacheServiceMBean`

    - #### getKeyCacheKeysToSave

          public int getKeyCacheKeysToSave()

      Specified by:
        `getKeyCacheKeysToSave` in interface `CacheServiceMBean`

    - #### setKeyCacheKeysToSave

          public void setKeyCacheKeysToSave(int count)

      Specified by:
        `setKeyCacheKeysToSave` in interface `CacheServiceMBean`

    - #### getCounterCacheKeysToSave

          public int getCounterCacheKeysToSave()

      Specified by:
        `getCounterCacheKeysToSave` in interface `CacheServiceMBean`

    - #### setCounterCacheKeysToSave

          public void setCounterCacheKeysToSave(int count)

      Specified by:
        `setCounterCacheKeysToSave` 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`

    - #### invalidateKeyCacheForCf

          public void invalidateKeyCacheForCf(java.util.UUID cfId)

    - #### 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`

    - #### invalidateRowCacheForCf

          public void invalidateRowCacheForCf(java.util.UUID cfId)

    - #### invalidateCounterCacheForCf

          public void invalidateCounterCacheForCf(java.util.UUID cfId)

    - #### invalidateCounterCache

          public void invalidateCounterCache()

      Specified by:
        `invalidateCounterCache` 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`

    - #### setCounterCacheCapacityInMB

          public void setCounterCacheCapacityInMB(long capacity)

      Specified by:
        `setCounterCacheCapacityInMB` 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`

    - #### 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 © 2014 The Apache Software Foundation