Class AbstractQueryCacheInstrument
java.lang.Object
org.apache.openjpa.lib.instrumentation.AbstractInstrument
org.apache.openjpa.instrumentation.AbstractQueryCacheInstrument
- All Implemented Interfaces:
QueryCacheInstrument,Instrument
- Direct Known Subclasses:
QueryCacheJMXInstrument
public abstract class AbstractQueryCacheInstrument
extends AbstractInstrument
implements QueryCacheInstrument
Provides a basic instrument implementation wrapper for the query cache. This
class can be extended to create a provider specific instrument for the
query cache.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longValue indicating that cache statistics are not available. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcount()Returns the number of total entries in the cache.longReturns number of total evictions since last resetlongReturns number of total execution requests since last resetlonggetExecutionCount(String queryKey) Returns number of total execution requests since last reset for the specified string-ified query key.longReturns number of total read requests that have been found in cache since last reset.longgetHitCount(String queryKey) Returns number of total read requests that have been found in cache since last reset for the specified string-ified query key.getLevel()Gets the instrumentation level of this instrument.longReturns number of total eviction requests since start.longReturns number of total exec requests since start.longgetTotalExecutionCount(String queryKey) Returns number of total exec requests since start for the specified string-ified query key.longReturns number of total read requests that has been found since start.longgetTotalHitCount(String queryKey) Returns number of total read requests that has been found since start for the specified string-ified query key.Returns all query keys currently tracked in the cache.voidreset()Resets cache statisticsvoidsetConfigId(String cid) voidsetContextRef(String cref) voidvoidReturns date since cache statistics collection were last reset.Returns date cache statistics collection started.Methods inherited from class org.apache.openjpa.lib.instrumentation.AbstractInstrument
getContext, getName, getOptions, getProvider, initialize, isStarted, restart, setContext, setOptions, setProvider, setStartedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.openjpa.lib.instrumentation.Instrument
start, stop
-
Field Details
-
NO_STATS
public static final long NO_STATSValue indicating that cache statistics are not available.- See Also:
-
-
Constructor Details
-
AbstractQueryCacheInstrument
public AbstractQueryCacheInstrument()
-
-
Method Details
-
setQueryCache
-
setConfigId
-
setContextRef
-
getConfigId
-
getContextRef
-
setPreparedQueryCache
-
getExecutionCount
public long getExecutionCount()Description copied from interface:QueryCacheInstrumentReturns number of total execution requests since last reset- Specified by:
getExecutionCountin interfaceQueryCacheInstrument
-
getExecutionCount
Description copied from interface:QueryCacheInstrumentReturns number of total execution requests since last reset for the specified string-ified query key.- Specified by:
getExecutionCountin interfaceQueryCacheInstrument
-
getTotalExecutionCount
public long getTotalExecutionCount()Description copied from interface:QueryCacheInstrumentReturns number of total exec requests since start.- Specified by:
getTotalExecutionCountin interfaceQueryCacheInstrument
-
getTotalExecutionCount
Description copied from interface:QueryCacheInstrumentReturns number of total exec requests since start for the specified string-ified query key.- Specified by:
getTotalExecutionCountin interfaceQueryCacheInstrument
-
getHitCount
public long getHitCount()Description copied from interface:QueryCacheInstrumentReturns number of total read requests that have been found in cache since last reset.- Specified by:
getHitCountin interfaceQueryCacheInstrument
-
getHitCount
Description copied from interface:QueryCacheInstrumentReturns number of total read requests that have been found in cache since last reset for the specified string-ified query key.- Specified by:
getHitCountin interfaceQueryCacheInstrument
-
getTotalHitCount
public long getTotalHitCount()Description copied from interface:QueryCacheInstrumentReturns number of total read requests that has been found since start.- Specified by:
getTotalHitCountin interfaceQueryCacheInstrument
-
getTotalHitCount
Description copied from interface:QueryCacheInstrumentReturns number of total read requests that has been found since start for the specified string-ified query key.- Specified by:
getTotalHitCountin interfaceQueryCacheInstrument
-
reset
public void reset()Description copied from interface:QueryCacheInstrumentResets cache statistics- Specified by:
resetin interfaceQueryCacheInstrument
-
sinceDate
Description copied from interface:QueryCacheInstrumentReturns date since cache statistics collection were last reset.- Specified by:
sinceDatein interfaceQueryCacheInstrument
-
startDate
Description copied from interface:QueryCacheInstrumentReturns date cache statistics collection started.- Specified by:
startDatein interfaceQueryCacheInstrument
-
getEvictionCount
public long getEvictionCount()Returns number of total evictions since last reset- Specified by:
getEvictionCountin interfaceQueryCacheInstrument
-
getTotalEvictionCount
public long getTotalEvictionCount()Returns number of total eviction requests since start.- Specified by:
getTotalEvictionCountin interfaceQueryCacheInstrument
-
queryKeys
Returns all query keys currently tracked in the cache.- Specified by:
queryKeysin interfaceQueryCacheInstrument
-
count
public long count()Description copied from interface:QueryCacheInstrumentReturns the number of total entries in the cache.- Specified by:
countin interfaceQueryCacheInstrument- Returns:
- entries
-
getLevel
Description copied from interface:InstrumentGets the instrumentation level of this instrument. The instrumentation level determines if and when the instrument will automatically start and stop.- Specified by:
getLevelin interfaceInstrument- Overrides:
getLevelin classAbstractInstrument- Returns:
- the instrumentation level of the instrument
-