Top Description Fields Constructors Methods
net.sf.ehcache.management.sampled

public Class CacheSamplerImpl

extends Object
implements CacheSampler, CacheConfigurationListener
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.config.CacheConfigurationListener, net.sf.ehcache.management.sampled.CacheSampler, net.sf.ehcache.management.sampled.LegacyCacheStatistics
Imports
net.sf.ehcache.Cache, .CacheOperationOutcomes, .CacheOperationOutcomes.ClusterEventOutcomes, .CacheOperationOutcomes.NonStopOperationOutcomes, .CacheStoreHelper, .Ehcache, net.sf.ehcache.config.CacheConfiguration, .CacheConfigurationListener, .PersistenceConfiguration, .PinningConfiguration, .SearchAttribute, .TerracottaConfiguration.Consistency, net.sf.ehcache.search.Attribute, net.sf.ehcache.store.Store, .TerracottaStore, net.sf.ehcache.util.CacheTransactionHelper, net.sf.ehcache.util.counter.sampled.SampledCounter, .SampledRateCounter, .TimeStampedCounterValue, net.sf.ehcache.writer.writebehind.WriteBehindManager, org.slf4j.Logger, .LoggerFactory, org.terracotta.statistics.archive.Timestamped, java.util.ArrayList, .HashMap, .Map

An implementation of CacheSampler
Authors
Abhishek Sanoujam, byoukste There is stupid here -- *Sample() is the same as *Rate()

Field Summary

Modifier and TypeField and Description
private final Ehcache
private static final Logger
private static final double
private static final int

Constructor Summary

AccessConstructor and Description
public
CacheSamplerImpl(Ehcache
the cache object to use in initializing this sampled representation
cache
)

Constructor accepting the backing Ehcache

Method Summary

Modifier and TypeMethod and Description
public void
deregistered(CacheConfiguration config)

Implements net.sf.ehcache.config.CacheConfigurationListener.deregistered.

Indicates that this listener was removed from the given configuration
public void
diskCapacityChanged(int
previous capacity
oldCapacity
,
int
new capacity
newCapacity
)

Implements net.sf.ehcache.config.CacheConfigurationListener.diskCapacityChanged.

Indicates a change in the configurations disk store capacity
public void
dispose()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.dispose.

Method used to dispose this statistics.
public void
flush()

Implements net.sf.ehcache.management.sampled.CacheSampler.flush.

Flushes all cache items from memory to the disk store, and from the DiskStore to disk.
public long
public long
getAverageGetTimeNanos()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getAverageGetTimeNanos.

Average time in nanoseconds taken to get an element from the cache.
public long
getAverageGetTimeNanosMostRecentSample()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getAverageGetTimeNanosMostRecentSample.

Get most recent value for average time taken for get() operation in the cache.
public SampledRateCounter
getAverageGetTimeSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getAverageGetTimeSample.

Get the SampledRateCounter for average time taken for get() operation in the cache.
public long
public long
getAverageSearchTimeNanos()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getAverageSearchTimeNanos.

Get the average search execution time for searches finishing within the last sample period.
public SampledRateCounter
getAverageSearchTimeSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getAverageSearchTimeSample.

Get the SampledRateCounter for average search execution time for searches finishing within the last sample period.
pack-priv Ehcache

Returns:

the underlying Ehcache object
getCache
()

A package friendly method to allow dependants access to the underlying Ehcache object.

public long
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public SampledCounter
public long
public SampledCounter
public long
public SampledCounter
public long
public SampledCounter
public long
getCacheElementUpdatedMostRecentSample()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getCacheElementUpdatedMostRecentSample.

Get most recent value element updates , i.e. put() on elements with already existing keys in the cache
public SampledCounter
getCacheElementUpdatedSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getCacheElementUpdatedSample.

Get the SampledCounter element updates , i.e. put() on elements with already existing keys in the cache
public long
public long
public long
getCacheHitCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getCacheHitCount.

The number of times a requested item was found in the cache.
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public SampledCounter
public long
public int
getCacheHitRatio()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getCacheHitRatio.

The ratio of hits to accesses (hits + misses).
public int
public SampledCounter
public SampledCounter
public long
public long
public long
getCacheMissCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getCacheMissCount.

Number of times a requested element was not found in the cache.
public long
public long
getCacheMissExpiredMostRecentSample()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getCacheMissExpiredMostRecentSample.

Get most recent value for cache miss as result of the element getting expired.
public SampledCounter
getCacheMissExpiredSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getCacheMissExpiredSample.

Get the SampledCounter for cache miss as result of the element getting expired.
public long
public SampledCounter
public long
public long
getCacheMissNotFoundMostRecentSample()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getCacheMissNotFoundMostRecentSample.

Get most recent value for cache miss as result of the element not found in cache.
public SampledCounter
getCacheMissNotFoundSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getCacheMissNotFoundSample.

Get the SampledCounter for cache miss as result of the element not found in cache.
public long
public SampledCounter
public long
public SampledCounter
public long
public SampledCounter
public String
public long
public long
public long
public long
public long
public long
public long
public long
public long
public SampledCounter
getCacheXaCommitsSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getCacheXaCommitsSample.

Get the SampledCounter for number of XA Transaction commits that have completed in the interval.
public long
public SampledCounter
getCacheXaRollbacksSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getCacheXaRollbacksSample.

Get the SampledCounter for number of XA Transaction rollbacks that have completed in the interval.
public long
public long
getEvictedCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getEvictedCount.

Number of elements evicted from the cache.
public long
getExpiredCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getExpiredCount.

Number of elements expired since creation or last clear.
public boolean
getHasWriteBehindWriter()

Implements net.sf.ehcache.management.sampled.CacheSampler.getHasWriteBehindWriter.

Is there a registered Write-behind CacheWriter.
public long
getInMemoryHitCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getInMemoryHitCount.

Number of times a requested item was found in the Memory Store.
public long
getInMemoryMissCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getInMemoryMissCount.

Number of times a requested item was not found in the Memory Store.
public long
public long
public long
getLocalDiskSizeInBytes()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getLocalDiskSizeInBytes.

Number of of bytes used by entries in the DiskStore.
public SampledCounter
public SampledCounter
public long
public long
getLocalHeapSizeInBytes()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getLocalHeapSizeInBytes.

Number of of bytes used by entries in the MemoryStore.
public SampledCounter
public SampledCounter
public long
public long
getLocalOffHeapSizeInBytes()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getLocalOffHeapSizeInBytes.

Number of of bytes used by entries in the off-heap store.
public SampledCounter
public SampledCounter
public long
public String
public long
public String
public long
public String
public int
public long
public long
public long
public Long
getMaxGetTimeNanos()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getMaxGetTimeNanos.

Return maximum time taken for a get operation in the cache in nanoseconds.
public String
public Long
getMinGetTimeNanos()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getMinGetTimeNanos.

Return minimum time taken for a get operation in the cache in nanoseconds.
public long
public SampledCounter
public long
public long
public long
getNonStopFailureRate()

Implements net.sf.ehcache.management.sampled.CacheSampler.getNonStopFailureRate.

Gets the non stop failure most recent sample.
public SampledCounter
public long
public long
public long
public SampledCounter
public long
public long
public long
getNonStopSuccessRate()

Implements net.sf.ehcache.management.sampled.CacheSampler.getNonStopSuccessRate.

Gets the non stop success most recent sample.
public SampledCounter
public long
public long
public long
getNonStopTimeoutRate()

Implements net.sf.ehcache.management.sampled.CacheSampler.getNonStopTimeoutRate.

Gets the non stop timeout most recent sample.
public int
getNonstopTimeoutRatio()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getNonstopTimeoutRatio.

Get the ratio of nonstop timeouts+rejoin timeouts to operations
public SampledCounter
public long
getOffHeapHitCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getOffHeapHitCount.

Number of times a requested item was found in the off-heap store.
public long
getOffHeapMissCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getOffHeapMissCount.

Number of times a requested item was not found in the off-heap store.
public long
getOffHeapSize()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getOffHeapSize.

Deprecated use getLocalOffHeapSize()
Number of elements in the off-heap store.
public long
getOnDiskHitCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getOnDiskHitCount.

Number of times a requested item was found in the Disk Store.
public long
getOnDiskMissCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getOnDiskMissCount.

Number of times a requested item was not found in the Disk Store.
public long
getOnDiskSize()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getOnDiskSize.

Deprecated use getLocalDiskSize()
Number of elements in the DiskStore.
public String
public String
public long
getPutCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getPutCount.

Number of puts that has happened in the cache.
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public SampledCounter
public long
getRemovedCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getRemovedCount.

Number of elements removed since creation or last clear.
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public long
public long
public SampledCounter
public boolean
getSearchable()

Implements net.sf.ehcache.management.sampled.CacheSampler.getSearchable.

Is the cache configured for search.
public Map<String, String>
getSearchAttributes()

Implements net.sf.ehcache.management.sampled.CacheSampler.getSearchAttributes.

Get the declared search attributes and their type names.
public long
getSearchesPerSecond()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getSearchesPerSecond.

Get the number of searches that have finished execution in the last second.
public SampledCounter
getSearchesPerSecondSample()

Implements net.sf.ehcache.management.sampled.CacheSampler.getSearchesPerSecondSample.

Get the SampledCounter for number of searches that have finished in the interval.
public long
getSize()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getSize.

Size of the cache based on current accuracy settings.
public SampledCounter
public String
getStatus()

Implements net.sf.ehcache.management.sampled.CacheSampler.getStatus.

Gets the status attribute of the Cache.
public String
getTerracottaConsistency()

Implements net.sf.ehcache.management.sampled.CacheSampler.getTerracottaConsistency.

Returns a textual description of a Terracotta-clustered cache's consistency mode.
public long
public long
public boolean
public long
public long
public long
getUpdateCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getUpdateCount.

Number of updates that as happened in the cache.
public int
getWriterConcurrency()

Implements net.sf.ehcache.management.sampled.CacheSampler.getWriterConcurrency.

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

Implements net.sf.ehcache.management.sampled.CacheSampler.getWriterMaxQueueSize.

Returns the maximum size of any write-behind queues.
public long
getWriterQueueLength()

Implements net.sf.ehcache.management.sampled.CacheSampler.getWriterQueueLength.

Returns the total length of all write-behind queues for this cache.
public SampledCounter
public long
getXaCommitCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getXaCommitCount.

Return the Cache's XAResource commit calls count.
public long
getXaRecoveredCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getXaRecoveredCount.

Return the Cache's XAResource recovered XIDs count.
public long
getXaRollbackCount()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.getXaRollbackCount.

Return the Cache's XAResource rollback calls count.
public boolean
public boolean
public boolean
public boolean
isEternal()

Implements net.sf.ehcache.management.sampled.CacheSampler.isEternal.

Configuration property accessor.
public boolean
isLocalHeapCountBased()

Implements net.sf.ehcache.management.sampled.LegacyCacheStatistics.isLocalHeapCountBased.

Check if the local heap is measured with ARC or in element count.
public boolean
public boolean
public boolean
public boolean
public boolean
isPinned()

Implements net.sf.ehcache.management.sampled.CacheSampler.isPinned.

Configuration property accessor.
public boolean
isTerracottaClustered()

Implements net.sf.ehcache.management.sampled.CacheSampler.isTerracottaClustered.

Is the cache configured with Terracotta clustering?.
public void
loggingChanged(boolean
old value whether logging was enabled or not
oldValue
,
boolean
new value whether logging was enabled or not
newValue
)

Implements net.sf.ehcache.config.CacheConfigurationListener.loggingChanged.

Indicates a change in the configuration for enable/disable logging
public void
maxBytesLocalDiskChanged(final long
old value in bytes
oldValue
,
final long
new value in bytes
newValue
)

Implements net.sf.ehcache.config.CacheConfigurationListener.maxBytesLocalDiskChanged.

Indicates a change in the configuration for maxBytesLocalDisk setting
public void
maxBytesLocalHeapChanged(final long
old value in bytes
oldValue
,
final long
new value in bytes
newValue
)

Implements net.sf.ehcache.config.CacheConfigurationListener.maxBytesLocalHeapChanged.

Indicates a change in the configuration for maxBytesLocalHeap setting
public void
maxEntriesInCacheChanged(long
old value
oldCapacity
,
long
new value
newCapacity
)

Implements net.sf.ehcache.config.CacheConfigurationListener.maxEntriesInCacheChanged.

Indicates a change in the configuration for maxEntriesInCache setting
public void
memoryCapacityChanged(int
previous capacity
oldCapacity
,
int
new capacity
newCapacity
)

Implements net.sf.ehcache.config.CacheConfigurationListener.memoryCapacityChanged.

Indicates a change in the configurations memory store capacity
public void
registered(CacheConfiguration config)

Implements net.sf.ehcache.config.CacheConfigurationListener.registered.

Indicates that this listener was registered with the given configuration
public void
public void
setDiskExpiryThreadIntervalSeconds(long
the new disk expiry thread interval seconds
seconds
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setDiskExpiryThreadIntervalSeconds.

setDiskExpiryThreadIntervalSeconds.
public void
setDiskPersistent(boolean
the new disk persistent
diskPersistent
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setDiskPersistent.

setDiskPersistent.
public void
setEnabled(boolean
the new enabled
enabled
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setEnabled.

Enabled/disable the cache.
public void
setEternal(boolean
the new eternal
eternal
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setEternal.

setEternal.
public void
setLoggingEnabled(boolean
the new logging enabled
enabled
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setLoggingEnabled.

setLoggingEnabled.
public void
setMaxBytesLocalDisk(long
the new max bytes local disk
maxBytes
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxBytesLocalDisk.

setMaxBytesLocalDisk.
public void
setMaxBytesLocalDiskAsString(String
the new max bytes local disk as string
maxBytes
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxBytesLocalDiskAsString.

setMaxBytesLocalDisk.
public void
setMaxBytesLocalHeap(long
the new max bytes local heap
maxBytes
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxBytesLocalHeap.

setMaxBytesLocalHeap.
public void
setMaxBytesLocalHeapAsString(String
the new max bytes local heap as string
maxBytes
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxBytesLocalHeapAsString.

setMaxBytesLocalHeap.
public void
setMaxElementsOnDisk(int
the new max elements on disk
maxElements
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxElementsOnDisk.

setMaxElementsOnDisk.
public void
setMaxEntriesInCache(long
the new max entries in cache
maxEntries
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxEntriesInCache.

setMaxEntriesInCache.
public void
setMaxEntriesLocalDisk(long
the new max entries local disk
maxEntries
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxEntriesLocalDisk.

setMaxEntriesLocalDisk.
public void
setMaxEntriesLocalHeap(long
the new max entries local heap
maxEntries
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMaxEntriesLocalHeap.

setMaxEntriesLocalHeap.
public void
setMemoryStoreEvictionPolicy(String
the new memory store eviction policy
evictionPolicy
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setMemoryStoreEvictionPolicy.

setMemoryStoreEvictionPolicy.
public void
setNodeBulkLoadEnabled(boolean
the new node bulk load enabled
bulkLoadEnabled
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setNodeBulkLoadEnabled.

Enabled/disable bulk-load mode for this node.
public void
setOverflowToDisk(boolean
the new overflow to disk
overflowToDisk
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setOverflowToDisk.

setOverflowToDisk.
public void
setTimeToIdleSeconds(long
the new time to idle seconds
tti
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setTimeToIdleSeconds.

setTimeToIdleSeconds.
public void
setTimeToLiveSeconds(long
the new time to live seconds
ttl
)

Implements net.sf.ehcache.management.sampled.CacheSampler.setTimeToLiveSeconds.

setTimeToLiveSeconds.
public void
timeToIdleChanged(long
previous time to idle value
oldTimeToIdle
,
long
new time to idle value
newTimeToIdle
)

Implements net.sf.ehcache.config.CacheConfigurationListener.timeToIdleChanged.

Indicates a change in the configurations time to idle
public void
timeToLiveChanged(long
previous time to live value
oldTimeToLive
,
long
new time to live value
newTimeToLive
)

Implements net.sf.ehcache.config.CacheConfigurationListener.timeToLiveChanged.

Indicates a change in the configurations time to live
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait