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

public Class CacheManagerSamplerImpl

extends Object
implements CacheManagerSampler
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.management.sampled.CacheManagerSampler
Imports
java.util.ArrayList, .HashMap, .HashSet, .List, .Map, .Set, net.sf.ehcache.CacheException, .CacheManager, .Ehcache, net.sf.ehcache.config.CacheWriterConfiguration, .SearchAttribute, net.sf.ehcache.search.Attribute, .Query, .Result, .Results, .SearchException, net.sf.ehcache.search.aggregator.Aggregator, net.sf.ehcache.search.expression.Criteria, net.sf.ehcache.search.query.QueryManagerBuilder, net.sf.ehcache.statistics.FlatStatistics, net.sf.ehcache.store.StoreQuery, .StoreQuery.Ordering, net.sf.ehcache.writer.writebehind.WriteBehindManager

An implementation of CacheManagerSampler
Authors
Abhishek Sanoujam, byoukste

Field Summary

Modifier and TypeField and Description
private final CacheManager
private static final int

Constructor Summary

AccessConstructor and Description
public
CacheManagerSamplerImpl(CacheManager
to wrap
cacheManager
)

Constructor taking the backing CacheManager

Method Summary

Modifier and TypeMethod and Description
public void
clearAll()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.clearAll.

Clears the contents of all caches in the CacheManager, but without removing any caches.
public Object[][]
executeQuery(String queryString)

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.executeQuery.

Execute a BMSQL query against the CacheManager and return result grid.
pack-priv Object[][]
executeQuery(String queryString, QueryManagerBuilder
the QueryManagerBuilder to use for this query
qmb
)

Execute a BMSQL query against the CacheManager and return result grid.

public String
public String
public float
public long
public long
public long
public long
public long
public long
public Map<String, long[]>
getCacheMetrics()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheMetrics.

Get a map of cache name to performance metrics (hits, misses).
public long
public String[]
getCacheNames()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheNames.

Gets the cache names managed by the CacheManager
public long
public long
public long
public long
public long
public long
public long
public long
public String
public boolean
getHasWriteBehindWriter()

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

Returns whether any caches are configured for write-behind
public long
getMaxBytesLocalDisk()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalDisk.

Maximum number of bytes of entries in the disk stores of all caches that did not declare their own max size.
public String
public long
getMaxBytesLocalHeap()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalHeap.

Maximum number of bytes of entries in the heap memory stores of all caches that did not declare their own max size.
public String
public long
getMaxBytesLocalOffHeap()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalOffHeap.

Maximum number of bytes of entries in the off-heap stores of all caches that did not declare their own max size.
public String
public String
getName()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getName.

Gets the actual name of the cache manager.
public boolean
public String
getStatus()

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

Gets the status attribute of the Ehcache
public boolean
public long
public long
public long
public long
public long
public int
getWriterMaxQueueSize()

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

Maximum elements that can be queued for processing by the write-behind writer
public long
getWriterQueueLength()

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

Returns the total length of all write-behind queues across all caches
public boolean
isEnabled()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.isEnabled.

Returns if each cache is enabled.
private Query
private Object
primitiveOrString(Object value)

If the value is a primitive, return it, else return string form.

public void
setEnabled(boolean enabled)

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

Enables/disables each cache contained by this CacheManager
public void
public void
public void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheManagerback to summary
private final CacheManager cacheManager
MAX_QUERY_RESULT_LIMITback to summary
private static final int MAX_QUERY_RESULT_LIMIT

Constructor Detail

CacheManagerSamplerImplback to summary
public CacheManagerSamplerImpl(CacheManager cacheManager)

Constructor taking the backing CacheManager

Parameters
cacheManager:CacheManager

to wrap

Method Detail

clearAllback to summary
public void clearAll()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.clearAll.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.clearAll.

Clears the contents of all caches in the CacheManager, but without removing any caches.

This method is not synchronized. It only guarantees to clear those elements in a cache at the time that the net.sf.ehcache.Ehcache#removeAll() mehod on each cache is called.

executeQueryback to summary
public Object[][] executeQuery(String queryString) throws SearchException

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.executeQuery.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.executeQuery.

Execute a BMSQL query against the CacheManager and return result grid.

Returns:Object[][]

query result grid

Annotations
@Override
executeQueryback to summary
pack-priv Object[][] executeQuery(String queryString, QueryManagerBuilder qmb) throws SearchException

Execute a BMSQL query against the CacheManager and return result grid.

Parameters
qmb:QueryManagerBuilder

the QueryManagerBuilder to use for this query

generateActiveConfigDeclarationback to summary
public String generateActiveConfigDeclaration()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.generateActiveConfigDeclaration.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.generateActiveConfigDeclaration.

generateActiveConfigDeclaration

Returns:String

CacheManager configuration as String

generateActiveConfigDeclarationback to summary
public String generateActiveConfigDeclaration(String cacheName)

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.generateActiveConfigDeclaration.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.generateActiveConfigDeclaration.

generateActiveConfigDeclaration

Returns:String

Cache configuration as String

getCacheAverageGetTimeback to summary
public float getCacheAverageGetTime()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheAverageGetTime.

Returns:float

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheAverageGetTime.

aggregate average get time (ms.)

getCacheAverageSearchTimeback to summary
public long getCacheAverageSearchTime()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheAverageSearchTime.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheAverageSearchTime.

aggregate search time

getCacheEvictionRateback to summary
public long getCacheEvictionRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheEvictionRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheEvictionRate.

aggregate eviction rate

getCacheExpirationRateback to summary
public long getCacheExpirationRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheExpirationRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheExpirationRate.

aggregate expiration rate

getCacheHitRateback to summary
public long getCacheHitRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheHitRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheHitRate.

aggregate hit rate

getCacheInMemoryHitRateback to summary
public long getCacheInMemoryHitRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheInMemoryHitRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheInMemoryHitRate.

aggregate in-memory hit rate

getCacheInMemoryMissRateback to summary
public long getCacheInMemoryMissRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheInMemoryMissRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheInMemoryMissRate.

aggregate in-memory miss rate

getCacheMetricsback to summary
public Map<String, long[]> getCacheMetrics()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheMetrics.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheMetrics.

Get a map of cache name to performance metrics (hits, misses).

Returns:Map<String, long[]>

a map of cache metrics

getCacheMissRateback to summary
public long getCacheMissRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheMissRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheMissRate.

aggregate miss rate

getCacheNamesback to summary
public String[] getCacheNames() throws IllegalStateException

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheNames.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheNames.

Gets the cache names managed by the CacheManager

getCacheOffHeapHitRateback to summary
public long getCacheOffHeapHitRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheOffHeapHitRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheOffHeapHitRate.

aggregate off-heap hit rate

getCacheOffHeapMissRateback to summary
public long getCacheOffHeapMissRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheOffHeapMissRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheOffHeapMissRate.

aggregate off-heap miss rate

getCacheOnDiskHitRateback to summary
public long getCacheOnDiskHitRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheOnDiskHitRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheOnDiskHitRate.

aggregate on-disk hit rate

getCacheOnDiskMissRateback to summary
public long getCacheOnDiskMissRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheOnDiskMissRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheOnDiskMissRate.

aggregate on-disk miss rate

getCachePutRateback to summary
public long getCachePutRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCachePutRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCachePutRate.

aggregate put rate

getCacheRemoveRateback to summary
public long getCacheRemoveRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheRemoveRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheRemoveRate.

aggregate remove rate

getCacheSearchRateback to summary
public long getCacheSearchRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheSearchRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheSearchRate.

aggregate search rate

getCacheUpdateRateback to summary
public long getCacheUpdateRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheUpdateRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheUpdateRate.

aggregate update rate

getClusterUUIDback to summary
public String getClusterUUID()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getClusterUUID.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getClusterUUID.

Gets the cluster uuid if applicable.

Returns:String

the cluster uuid

getHasWriteBehindWriterback to summary
public boolean getHasWriteBehindWriter()

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

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getHasWriteBehindWriter.

Returns whether any caches are configured for write-behind

getMaxBytesLocalDiskback to summary
public long getMaxBytesLocalDisk()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalDisk.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalDisk.

Maximum number of bytes of entries in the disk stores of all caches that did not declare their own max size.

Returns:long

maximum number of bytes in the disk stores of all caches that did not declare their own max size.

getMaxBytesLocalDiskAsStringback to summary
public String getMaxBytesLocalDiskAsString()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalDiskAsString.

Returns:String

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalDiskAsString.

Original input for maxBytesLocalDisk

getMaxBytesLocalHeapback to summary
public long getMaxBytesLocalHeap()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalHeap.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalHeap.

Maximum number of bytes of entries in the heap memory stores of all caches that did not declare their own max size.

Returns:long

maximum number of bytes in the heap memory stores of all caches that did not declare their own max size.

getMaxBytesLocalHeapAsStringback to summary
public String getMaxBytesLocalHeapAsString()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalHeapAsString.

Returns:String

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalHeapAsString.

Original input for maxBytesLocalHeap

getMaxBytesLocalOffHeapback to summary
public long getMaxBytesLocalOffHeap()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalOffHeap.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalOffHeap.

Maximum number of bytes of entries in the off-heap stores of all caches that did not declare their own max size.

Returns:long

maximum number of bytes in the off-heap stores of all caches that did not declare their own max size.

getMaxBytesLocalOffHeapAsStringback to summary
public String getMaxBytesLocalOffHeapAsString()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalOffHeapAsString.

Returns:String

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalOffHeapAsString.

Original input for maxBytesLocalOffHeap

getNameback to summary
public String getName()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getName.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getName.

Gets the actual name of the cache manager.

getSearchableback to summary
public boolean getSearchable()

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

Returns:boolean

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getSearchable.

if any contained caches are configured for search

getStatusback to summary
public String getStatus()

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

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getStatus.

Gets the status attribute of the Ehcache

Returns:String

The status value, as a String from the Status enum class

getTransactionalback to summary
public boolean getTransactional()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactional.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactional.

Are any of the caches transactional

getTransactionCommitRateback to summary
public long getTransactionCommitRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionCommitRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionCommitRate.

aggregate Xa commit rate

getTransactionCommittedCountback to summary
public long getTransactionCommittedCount()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionCommittedCount.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionCommittedCount.

Get the committed transactions count

Returns:long

the committed transactions count

getTransactionRollbackRateback to summary
public long getTransactionRollbackRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionRollbackRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionRollbackRate.

aggregate Xa rollback rate

getTransactionRolledBackCountback to summary
public long getTransactionRolledBackCount()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionRolledBackCount.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionRolledBackCount.

Get the rolled back transactions count

Returns:long

the rolled back transactions count

getTransactionTimedOutCountback to summary
public long getTransactionTimedOutCount()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionTimedOutCount.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionTimedOutCount.

Get the timed out transactions count. Note that only transactions which failed to commit due to a timeout are taken into account

Returns:long

the timed out transactions count

getWriterMaxQueueSizeback to summary
public int getWriterMaxQueueSize()

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

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getWriterMaxQueueSize.

Maximum elements that can be queued for processing by the write-behind writer

Returns:int

aggregate of the maximum elements that can be waiting to be processed by the write-behind writer across all caches

getWriterQueueLengthback to summary
public long getWriterQueueLength()

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

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getWriterQueueLength.

Returns the total length of all write-behind queues across all caches

Returns:long

aggregate writer-behind queue length

isEnabledback to summary
public boolean isEnabled() throws CacheException

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.isEnabled.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.isEnabled.

Returns if each cache is enabled.

Returns:boolean

boolean indicating that each cache is enabled

limitResultsback to summary
private Query limitResults(Query q)
primitiveOrStringback to summary
private Object primitiveOrString(Object value)

If the value is a primitive, return it, else return string form.

setEnabledback to summary
public void setEnabled(boolean enabled)

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

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.setEnabled.

Enables/disables each cache contained by this CacheManager

setMaxBytesLocalDiskback to summary
public void setMaxBytesLocalDisk(long maxBytes)

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

setMaxBytesLocalDiskAsStringback to summary
public void setMaxBytesLocalDiskAsString(String maxBytes)

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

setMaxBytesLocalHeapback to summary
public void setMaxBytesLocalHeap(long maxBytes)

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

setMaxBytesLocalHeapAsStringback to summary
public void setMaxBytesLocalHeapAsString(String maxBytes)

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

shutdownback to summary
public void shutdown()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.shutdown.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.shutdown.

Shuts down the CacheManager.

If the shutdown occurs on the singleton, then the singleton is removed, so that if a singleton access method is called, a new singleton will be created.