mirror of https://github.com/apache/openjpa.git
OPENJPA-1717: Disable FinderCache statistics by default.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@961017 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
17246f5ff2
commit
1738c1f33b
|
@ -58,11 +58,12 @@ public class FinderCacheImpl
|
||||||
private List<String> _exclusionPatterns;
|
private List<String> _exclusionPatterns;
|
||||||
private QueryStatistics<ClassMapping> _stats;
|
private QueryStatistics<ClassMapping> _stats;
|
||||||
private ReentrantLock _lock = new ReentrantLock();
|
private ReentrantLock _lock = new ReentrantLock();
|
||||||
|
private boolean _enableStats = false;
|
||||||
|
|
||||||
public FinderCacheImpl() {
|
public FinderCacheImpl() {
|
||||||
_delegate = new HashMap<ClassMapping, FinderQuery<ClassMapping, SelectExecutor, Result>>();
|
_delegate = new HashMap<ClassMapping, FinderQuery<ClassMapping, SelectExecutor, Result>>();
|
||||||
_uncachables = new HashMap<String, String>();
|
_uncachables = new HashMap<String, String>();
|
||||||
_stats = new QueryStatistics.Default<ClassMapping>();
|
_stats = new QueryStatistics.None<ClassMapping>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -364,6 +365,16 @@ public class FinderCacheImpl
|
||||||
_lock.unlock();
|
_lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setEnableStats(boolean b) {
|
||||||
|
_enableStats = b;
|
||||||
|
if (_enableStats) {
|
||||||
|
_stats = new QueryStatistics.Default<ClassMapping>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getEnableStats() {
|
||||||
|
return _enableStats;
|
||||||
|
}
|
||||||
// ----------------------------------------------------
|
// ----------------------------------------------------
|
||||||
// Configuration contract
|
// Configuration contract
|
||||||
// ----------------------------------------------------
|
// ----------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue