ehcache

net.sf.ehcache.management.sampled
Interface SampledCacheMBean

All Superinterfaces:
LiveCacheStatistics, SampledCacheStatistics
All Known Implementing Classes:
SampledCache

public interface SampledCacheMBean
extends LiveCacheStatistics, SampledCacheStatistics

An MBean for Cache exposing cache statistics. Extends from both LiveCacheStatistics and SampledCacheStatistics

Since:
1.7
Author:
Abhishek Sanoujam

Field Summary
static String CACHE_CHANGED
          CACHE_CHANGED
static String CACHE_CLEARED
          CACHE_CLEARED
static String CACHE_ENABLED
          CACHE_ENABLED
static String CACHE_FLUSHED
          CACHE_FLUSHED
static String CACHE_STATISTICS_ENABLED
          CACHE_STATISTICS_ENABLED
static String CACHE_STATISTICS_RESET
          CACHE_STATISTICS_RESET
 
Method Summary
 void clearStatistics()
          Clear both sampled and cumulative statistics
 void disableSampledStatistics()
          Disables statistics collection
 void disableStatistics()
          Disables statistics collection.
 void enableSampledStatistics()
          Enables statistics collection.
 void enableStatistics()
          Enables statistics collection
 void flush()
          Flushes all cache items from memory to the disk store, and from the DiskStore to disk.
 float getCacheAverageGetTime()
           
 long getCacheAverageSearchTime()
           
 long getCacheEvictionRate()
           
 long getCacheExpirationRate()
           
 long getCacheHitRate()
           
 long getCacheInMemoryHitRate()
           
 long getCacheInMemoryMissRate()
           
 long getCacheMissRate()
           
 long getCacheOffHeapHitRate()
           
 long getCacheOffHeapMissRate()
           
 long getCacheOnDiskHitRate()
           
 long getCacheOnDiskMissRate()
           
 long getCachePutRate()
           
 long getCacheRemoveRate()
           
 long getCacheSearchRate()
           
 long getCacheUpdateRate()
           
 long getDiskExpiryThreadIntervalSeconds()
          Configuration property accessor
 boolean getHasWriteBehindWriter()
          Is there a registered Write-behind CacheWriter
 long getMaxBytesLocalDisk()
          Configuration property accessor
 String getMaxBytesLocalDiskAsString()
          Configuration property accessor
 long getMaxBytesLocalHeap()
          Configuration property accessor
 String getMaxBytesLocalHeapAsString()
          Configuration property accessor
 long getMaxBytesLocalOffHeap()
          Configuration property accessor
 String getMaxBytesLocalOffHeapAsString()
          Configuration property accessor
 int getMaxElementsInMemory()
          Deprecated. use getMaxEntriesLocalHeap() instead
 int getMaxElementsOnDisk()
          Deprecated. use getMaxEntriesLocalDisk() instead
 long getMaxEntriesLocalDisk()
          Configuration property accessor
 long getMaxEntriesLocalHeap()
          Configuration property accessor
 String getMemoryStoreEvictionPolicy()
          Configuration property accessor
 String getPinnedToStore()
          Configuration property accessor
 boolean getSearchable()
          Is the cache configured for search
 String getStatus()
          Gets the status attribute of the Cache.
 String getTerracottaConsistency()
          Returns a textual description of a Terracotta-clustered cache's consistency mode.
 String getTerracottaStorageStrategy()
          Returns a textual description of a Terracotta-clustered cache's storage-strategy.
 long getTimeToIdleSeconds()
          Configuration property accessor
 long getTimeToLiveSeconds()
          Configuration property accessor
 boolean getTransactional()
          Is the cache a transactional one
 long getTransactionCommitRate()
           
 long getTransactionRollbackRate()
           
 int getWriterConcurrency()
          Returns the number of configured write-behind queues/threads.
 int getWriterMaxQueueSize()
          Returns the maximum size of any write-behind queues.
 long getWriterQueueLength()
          Returns the total length of all write-behind queues for this cache
 boolean isClusterBulkLoadEnabled()
          Is the cache in bulk-load mode cluster-wide?
 boolean isClusterCoherent()
          Deprecated. use isClusterBulkLoadEnabled() instead
 boolean isDiskPersistent()
          Configuration property accessor
 boolean isEnabled()
          Is the cache enabled?
 boolean isEternal()
          Configuration property accessor
 boolean isLoggingEnabled()
          Configuration property accessor
 boolean isNodeBulkLoadEnabled()
          Is the cache in bulk-load mode locally?
 boolean isNodeCoherent()
          Deprecated. use isNodeBulkLoadEnabled() instead
 boolean isOverflowToDisk()
          Configuration property accessor
 boolean isPinned()
          Configuration property accessor
 boolean isTerracottaClustered()
          Is the cache configured with Terracotta clustering?
 void removeAll()
          Removes all cached items.
 void setDiskExpiryThreadIntervalSeconds(long seconds)
          setDiskExpiryThreadIntervalSeconds
 void setDiskPersistent(boolean diskPersistent)
          setDiskPersistent
 void setEnabled(boolean enabled)
          Enabled/disable the cache.
 void setEternal(boolean eternal)
          setEternal
 void setLoggingEnabled(boolean enabled)
          setLoggingEnabled
 void setMaxBytesLocalDisk(long maxBytes)
          setMaxBytesLocalDisk
 void setMaxBytesLocalDiskAsString(String maxBytes)
          setMaxBytesLocalDisk
 void setMaxBytesLocalHeap(long maxBytes)
          setMaxBytesLocalHeap
 void setMaxBytesLocalHeapAsString(String maxBytes)
          setMaxBytesLocalHeap
 void setMaxElementsInMemory(int maxElements)
          setMaxElementsInMemory
 void setMaxElementsOnDisk(int maxElements)
          setMaxElementsOnDisk
 void setMaxEntriesLocalDisk(long maxEntries)
          setMaxEntriesLocalDisk
 void setMaxEntriesLocalHeap(long maxEntries)
          setMaxEntriesLocalHeap
 void setMemoryStoreEvictionPolicy(String evictionPolicy)
          setMemoryStoreEvictionPolicy
 void setNodeBulkLoadEnabled(boolean bulkLoadEnabled)
          Enabled/disable bulk-load mode for this node.
 void setNodeCoherent(boolean coherent)
          Deprecated. use setNodeBulkLoadEnabled(boolean) instead
 void setOverflowToDisk(boolean overflowToDisk)
          setOverflowToDisk
 void setStatisticsEnabled(boolean statsEnabled)
          Controls the statistics.
 void setTimeToIdleSeconds(long tti)
          setTimeToIdleSeconds
 void setTimeToLiveSeconds(long ttl)
          setTimeToLiveSeconds
 
Methods inherited from interface net.sf.ehcache.statistics.LiveCacheStatistics
getAverageGetTimeMillis, getCacheHitCount, getCacheMissCount, getCacheMissCountExpired, getCacheName, getEvictedCount, getExpiredCount, getInMemoryHitCount, getInMemoryMissCount, getInMemorySize, getLocalDiskSize, getLocalDiskSizeInBytes, getLocalHeapSize, getLocalHeapSizeInBytes, getLocalOffHeapSize, getLocalOffHeapSizeInBytes, getMaxGetTimeMillis, getMinGetTimeMillis, getOffHeapHitCount, getOffHeapMissCount, getOffHeapSize, getOnDiskHitCount, getOnDiskMissCount, getOnDiskSize, getPutCount, getRemovedCount, getSize, getStatisticsAccuracy, getStatisticsAccuracyDescription, getUpdateCount, getXaCommitCount, getXaRollbackCount, isStatisticsEnabled
 
Methods inherited from interface net.sf.ehcache.statistics.sampled.SampledCacheStatistics
dispose, getAverageGetTimeMostRecentSample, getAverageSearchTime, getCacheElementEvictedMostRecentSample, getCacheElementExpiredMostRecentSample, getCacheElementPutMostRecentSample, getCacheElementRemovedMostRecentSample, getCacheElementUpdatedMostRecentSample, getCacheHitInMemoryMostRecentSample, getCacheHitMostRecentSample, getCacheHitOffHeapMostRecentSample, getCacheHitOnDiskMostRecentSample, getCacheMissExpiredMostRecentSample, getCacheMissInMemoryMostRecentSample, getCacheMissMostRecentSample, getCacheMissNotFoundMostRecentSample, getCacheMissOffHeapMostRecentSample, getCacheMissOnDiskMostRecentSample, getCacheXaCommitsMostRecentSample, getCacheXaRollbacksMostRecentSample, getSearchesPerSecond, getStatisticsAccuracy, getStatisticsAccuracyDescription, isSampledStatisticsEnabled
 

Field Detail

CACHE_ENABLED

static final String CACHE_ENABLED
CACHE_ENABLED

See Also:
Constant Field Values

CACHE_CHANGED

static final String CACHE_CHANGED
CACHE_CHANGED

See Also:
Constant Field Values

CACHE_FLUSHED

static final String CACHE_FLUSHED
CACHE_FLUSHED

See Also:
Constant Field Values

CACHE_CLEARED

static final String CACHE_CLEARED
CACHE_CLEARED

See Also:
Constant Field Values

CACHE_STATISTICS_ENABLED

static final String CACHE_STATISTICS_ENABLED
CACHE_STATISTICS_ENABLED

See Also:
Constant Field Values

CACHE_STATISTICS_RESET

static final String CACHE_STATISTICS_RESET
CACHE_STATISTICS_RESET

See Also:
Constant Field Values
Method Detail

isEnabled

boolean isEnabled()
Is the cache enabled?


setNodeCoherent

@Deprecated
void setNodeCoherent(boolean coherent)
Deprecated. use setNodeBulkLoadEnabled(boolean) instead

Enabled/disable cache coherence mode for this node.


setNodeBulkLoadEnabled

void setNodeBulkLoadEnabled(boolean bulkLoadEnabled)
Enabled/disable bulk-load mode for this node.


isClusterCoherent

@Deprecated
boolean isClusterCoherent()
Deprecated. use isClusterBulkLoadEnabled() instead

Is the cache coherent cluster-wide?


isClusterBulkLoadEnabled

boolean isClusterBulkLoadEnabled()
Is the cache in bulk-load mode cluster-wide?


isNodeCoherent

@Deprecated
boolean isNodeCoherent()
Deprecated. use isNodeBulkLoadEnabled() instead

Is the cache coherent locally?


isNodeBulkLoadEnabled

boolean isNodeBulkLoadEnabled()
Is the cache in bulk-load mode locally?


setEnabled

void setEnabled(boolean enabled)
Enabled/disable the cache.


removeAll

void removeAll()
Removes all cached items.


flush

void flush()
Flushes all cache items from memory to the disk store, and from the DiskStore to disk.


getStatus

String getStatus()
Gets the status attribute of the Cache.

Returns:
The status value from the Status enum class

isTerracottaClustered

boolean isTerracottaClustered()
Is the cache configured with Terracotta clustering?

Returns:
true if clustered with terracotta

getTerracottaConsistency

String getTerracottaConsistency()
Returns a textual description of a Terracotta-clustered cache's consistency mode.

Returns:
"STRONG", "EVENTUAL", or "na" if the cache is not Terracotta-clustered

getTerracottaStorageStrategy

String getTerracottaStorageStrategy()
Returns a textual description of a Terracotta-clustered cache's storage-strategy.

Returns:
"CDV2", "CLASSIC", or "na" if the cache is not Terracotta-clustered

clearStatistics

void clearStatistics()
Clear both sampled and cumulative statistics

Specified by:
clearStatistics in interface LiveCacheStatistics
Specified by:
clearStatistics in interface SampledCacheStatistics

enableStatistics

void enableStatistics()
Enables statistics collection


disableStatistics

void disableStatistics()
Disables statistics collection. Also disables sampled statistics if it is enabled.


setStatisticsEnabled

void setStatisticsEnabled(boolean statsEnabled)
Controls the statistics. Also controls sampled statistics if it is enabled.


enableSampledStatistics

void enableSampledStatistics()
Enables statistics collection. As it requires that normal statistics collection to be enabled, it enables it if its not already


disableSampledStatistics

void disableSampledStatistics()
Disables statistics collection


getMaxEntriesLocalHeap

long getMaxEntriesLocalHeap()
Configuration property accessor

Returns:
Max entries local heap config setting value

setMaxEntriesLocalHeap

void setMaxEntriesLocalHeap(long maxEntries)
setMaxEntriesLocalHeap

Parameters:
maxEntries -

getMaxElementsInMemory

@Deprecated
int getMaxElementsInMemory()
Deprecated. use getMaxEntriesLocalHeap() instead

Configuration property accessor

Returns:
Max elements in memory config setting value

setMaxElementsInMemory

void setMaxElementsInMemory(int maxElements)
setMaxElementsInMemory

Parameters:
maxElements -

getMaxBytesLocalHeap

long getMaxBytesLocalHeap()
Configuration property accessor

Returns:
Max bytes local heap config setting value

setMaxBytesLocalHeap

void setMaxBytesLocalHeap(long maxBytes)
setMaxBytesLocalHeap

Parameters:
maxBytes -

setMaxBytesLocalHeapAsString

void setMaxBytesLocalHeapAsString(String maxBytes)
setMaxBytesLocalHeap

Parameters:
maxBytes -

getMaxBytesLocalHeapAsString

String getMaxBytesLocalHeapAsString()
Configuration property accessor

Returns:
Max bytes local heap config setting value as string

getMaxBytesLocalOffHeap

long getMaxBytesLocalOffHeap()
Configuration property accessor

Returns:
Max bytes local offheap config setting value

getMaxBytesLocalOffHeapAsString

String getMaxBytesLocalOffHeapAsString()
Configuration property accessor

Returns:
Max bytes local offheap config setting value as string

getMaxEntriesLocalDisk

long getMaxEntriesLocalDisk()
Configuration property accessor

Returns:
Max entries local disk config setting value

setMaxEntriesLocalDisk

void setMaxEntriesLocalDisk(long maxEntries)
setMaxEntriesLocalDisk

Parameters:
maxEntries -

getMaxElementsOnDisk

@Deprecated
int getMaxElementsOnDisk()
Deprecated. use getMaxEntriesLocalDisk() instead

Configuration property accessor

Returns:
Max elements on disk config setting value

setMaxElementsOnDisk

void setMaxElementsOnDisk(int maxElements)
setMaxElementsOnDisk

Parameters:
maxElements -

getMaxBytesLocalDisk

long getMaxBytesLocalDisk()
Configuration property accessor

Returns:
Max bytes local disk config setting value

setMaxBytesLocalDisk

void setMaxBytesLocalDisk(long maxBytes)
setMaxBytesLocalDisk

Parameters:
maxBytes -

setMaxBytesLocalDiskAsString

void setMaxBytesLocalDiskAsString(String maxBytes)
setMaxBytesLocalDisk

Parameters:
maxBytes -

getMaxBytesLocalDiskAsString

String getMaxBytesLocalDiskAsString()
Configuration property accessor

Returns:
Max bytes local disk config setting value as string

getMemoryStoreEvictionPolicy

String getMemoryStoreEvictionPolicy()
Configuration property accessor

Returns:
a String representation of the policy

setMemoryStoreEvictionPolicy

void setMemoryStoreEvictionPolicy(String evictionPolicy)
setMemoryStoreEvictionPolicy

Parameters:
evictionPolicy -

isEternal

boolean isEternal()
Configuration property accessor

Returns:
true if set to eternal in config

setEternal

void setEternal(boolean eternal)
setEternal

Parameters:
eternal -

getTimeToIdleSeconds

long getTimeToIdleSeconds()
Configuration property accessor

Returns:
TTI in config

setTimeToIdleSeconds

void setTimeToIdleSeconds(long tti)
setTimeToIdleSeconds

Parameters:
tti -

getTimeToLiveSeconds

long getTimeToLiveSeconds()
Configuration property accessor

Returns:
TTL in config

setTimeToLiveSeconds

void setTimeToLiveSeconds(long ttl)
setTimeToLiveSeconds

Parameters:
ttl -

isOverflowToDisk

boolean isOverflowToDisk()
Configuration property accessor

Returns:
true if overflow to disk specified in config

setOverflowToDisk

void setOverflowToDisk(boolean overflowToDisk)
setOverflowToDisk

Parameters:
overflowToDisk -

isDiskPersistent

boolean isDiskPersistent()
Configuration property accessor

Returns:
true if configured with disk persistence

setDiskPersistent

void setDiskPersistent(boolean diskPersistent)
setDiskPersistent

Parameters:
diskPersistent -

getDiskExpiryThreadIntervalSeconds

long getDiskExpiryThreadIntervalSeconds()
Configuration property accessor

Returns:
Value for disk expiry thread interval in seconds specified in config

setDiskExpiryThreadIntervalSeconds

void setDiskExpiryThreadIntervalSeconds(long seconds)
setDiskExpiryThreadIntervalSeconds

Parameters:
seconds -

isLoggingEnabled

boolean isLoggingEnabled()
Configuration property accessor

Returns:
true if logging is enabled on the cache

setLoggingEnabled

void setLoggingEnabled(boolean enabled)
setLoggingEnabled

Parameters:
enabled -

isPinned

boolean isPinned()
Configuration property accessor

Returns:
true if the cache is pinned
See Also:
PinningConfiguration

getPinnedToStore

String getPinnedToStore()
Configuration property accessor

Returns:
the store to which this cache is pinned
See Also:
PinningConfiguration

getHasWriteBehindWriter

boolean getHasWriteBehindWriter()
Is there a registered Write-behind CacheWriter


getWriterQueueLength

long getWriterQueueLength()
Returns the total length of all write-behind queues for this cache

Specified by:
getWriterQueueLength in interface LiveCacheStatistics
Returns:
writer-behind queue length

getWriterMaxQueueSize

int getWriterMaxQueueSize()
Returns the maximum size of any write-behind queues.

Returns:
Maximum elements that can be queued for processing by the write-behind writer
See Also:
CacheWriterConfiguration.getWriteBehindMaxQueueSize()

getWriterConcurrency

int getWriterConcurrency()
Returns the number of configured write-behind queues/threads.

Returns:
Number of configured processing queues/threads for use by the write-behind writer
See Also:
CacheWriterConfiguration.getWriteBehindConcurrency()

getTransactional

boolean getTransactional()
Is the cache a transactional one

See Also:
CacheConfiguration.TransactionalMode

getTransactionCommitRate

long getTransactionCommitRate()
Returns:
Xa commit rate

getTransactionRollbackRate

long getTransactionRollbackRate()
Returns:
Xa rollback rate

getSearchable

boolean getSearchable()
Is the cache configured for search

See Also:
Searchable

getCacheSearchRate

long getCacheSearchRate()
Returns:
search rate

getCacheAverageSearchTime

long getCacheAverageSearchTime()
Returns:
search time

getCacheHitRate

long getCacheHitRate()
Returns:
hit rate

getCacheInMemoryHitRate

long getCacheInMemoryHitRate()
Returns:
in-memory hit rate

getCacheOffHeapHitRate

long getCacheOffHeapHitRate()
Returns:
off-heap hit rate

getCacheOnDiskHitRate

long getCacheOnDiskHitRate()
Returns:
on-disk hit rate

getCacheMissRate

long getCacheMissRate()
Returns:
miss rate

getCacheInMemoryMissRate

long getCacheInMemoryMissRate()
Returns:
in-memory miss rate

getCacheOffHeapMissRate

long getCacheOffHeapMissRate()
Returns:
off-heap miss rate

getCacheOnDiskMissRate

long getCacheOnDiskMissRate()
Returns:
on-disk miss rate

getCachePutRate

long getCachePutRate()
Returns:
put rate

getCacheUpdateRate

long getCacheUpdateRate()
Returns:
update rate

getCacheRemoveRate

long getCacheRemoveRate()
Returns:
remove rate

getCacheEvictionRate

long getCacheEvictionRate()
Returns:
eviction rate

getCacheExpirationRate

long getCacheExpirationRate()
Returns:
expiration rate

getCacheAverageGetTime

float getCacheAverageGetTime()
Returns:
average get time (ms.)

ehcache

Copyright © 2003-2012 Terracotta, Inc.. All Rights Reserved.