Package org.apache.openjpa.datacache
Class AbstractQueryCache.Default<T>
- java.lang.Object
-
- org.apache.openjpa.datacache.AbstractQueryCache.Default<T>
-
- All Implemented Interfaces:
Serializable,QueryStatistics<T>
- Enclosing class:
- AbstractQueryCache
public static class AbstractQueryCache.Default<T> extends Object implements QueryStatistics<T>
A default implementation of query statistics for the Query result cache. Maintains statistics for only a fixed number of queries. Statistical counts are approximate and not exact (to keep thread synchorization overhead low).- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.openjpa.kernel.QueryStatistics
QueryStatistics.Default<T>, QueryStatistics.None<T>
-
-
Constructor Summary
Constructors Constructor Description Default()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears all statistics accumulated since start.voiddump(PrintStream out)Dumps on the given output stream.longgetEvictionCount()Gets number of total query evictions since last reset.longgetExecutionCount()Gets number of total query execution since last reset.longgetExecutionCount(T query)Gets number of executions for the given query since last reset.longgetHitCount()Gets number of total query execution that are cached since last reset.longgetHitCount(T query)Gets number of executions for the given query that are cached since last reset.longgetTotalEvictionCount()Gets number of total query evictions since start.longgetTotalExecutionCount()Gets number of total query execution since start.longgetTotalExecutionCount(T query)Gets number of executions for the given query since start.longgetTotalHitCount()Gets number of total query execution that are cached since start.longgetTotalHitCount(T query)Gets number of executions for the given query that are cached since start.Set<T>keys()Gets all the identifier keys for the cached queries.voidrecordEviction(T query)Record that the given query has been evicted.voidrecordExecution(T query)Record that the given query has been executed.voidrecordHit(T query)voidreset()Clears all statistics accumulated since last reset.Datesince()Gets the time of last reset.Datestart()Gets the time of start.
-
-
-
Method Detail
-
keys
public Set<T> keys()
Description copied from interface:QueryStatisticsGets all the identifier keys for the cached queries.- Specified by:
keysin interfaceQueryStatistics<T>
-
getExecutionCount
public long getExecutionCount()
Description copied from interface:QueryStatisticsGets number of total query execution since last reset.- Specified by:
getExecutionCountin interfaceQueryStatistics<T>
-
getTotalExecutionCount
public long getTotalExecutionCount()
Description copied from interface:QueryStatisticsGets number of total query execution since start.- Specified by:
getTotalExecutionCountin interfaceQueryStatistics<T>
-
getExecutionCount
public long getExecutionCount(T query)
Description copied from interface:QueryStatisticsGets number of executions for the given query since last reset.- Specified by:
getExecutionCountin interfaceQueryStatistics<T>
-
getTotalExecutionCount
public long getTotalExecutionCount(T query)
Description copied from interface:QueryStatisticsGets number of executions for the given query since start.- Specified by:
getTotalExecutionCountin interfaceQueryStatistics<T>
-
getHitCount
public long getHitCount()
Description copied from interface:QueryStatisticsGets number of total query execution that are cached since last reset.- Specified by:
getHitCountin interfaceQueryStatistics<T>
-
getTotalHitCount
public long getTotalHitCount()
Description copied from interface:QueryStatisticsGets number of total query execution that are cached since start.- Specified by:
getTotalHitCountin interfaceQueryStatistics<T>
-
getHitCount
public long getHitCount(T query)
Description copied from interface:QueryStatisticsGets number of executions for the given query that are cached since last reset.- Specified by:
getHitCountin interfaceQueryStatistics<T>
-
getTotalHitCount
public long getTotalHitCount(T query)
Description copied from interface:QueryStatisticsGets number of executions for the given query that are cached since start.- Specified by:
getTotalHitCountin interfaceQueryStatistics<T>
-
getEvictionCount
public long getEvictionCount()
Description copied from interface:QueryStatisticsGets number of total query evictions since last reset.- Specified by:
getEvictionCountin interfaceQueryStatistics<T>
-
getTotalEvictionCount
public long getTotalEvictionCount()
Description copied from interface:QueryStatisticsGets number of total query evictions since start.- Specified by:
getTotalEvictionCountin interfaceQueryStatistics<T>
-
since
public Date since()
Description copied from interface:QueryStatisticsGets the time of last reset.- Specified by:
sincein interfaceQueryStatistics<T>
-
start
public Date start()
Description copied from interface:QueryStatisticsGets the time of start.- Specified by:
startin interfaceQueryStatistics<T>
-
reset
public void reset()
Description copied from interface:QueryStatisticsClears all statistics accumulated since last reset.- Specified by:
resetin interfaceQueryStatistics<T>
-
clear
public void clear()
Description copied from interface:QueryStatisticsClears all statistics accumulated since start.- Specified by:
clearin interfaceQueryStatistics<T>
-
recordExecution
public void recordExecution(T query)
Description copied from interface:QueryStatisticsRecord that the given query has been executed.- Specified by:
recordExecutionin interfaceQueryStatistics<T>
-
recordHit
public void recordHit(T query)
-
recordEviction
public void recordEviction(T query)
Description copied from interface:QueryStatisticsRecord that the given query has been evicted.- Specified by:
recordEvictionin interfaceQueryStatistics<T>
-
dump
public void dump(PrintStream out)
Description copied from interface:QueryStatisticsDumps on the given output stream.- Specified by:
dumpin interfaceQueryStatistics<T>
-
-