mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 22:41:35 +00:00
Refactor io.ebean.meta API, method rename with deprecation
This commit is contained in:
1 parent
3579557200
commit
801d419f51
45 files changed
+363
-257
No files matched your search
@@ -18,8 +18,8 @@ class DefaultQueryPlanListener implements QueryPlanListener {
|
||||
String dbName = capture.getDatabase().getName();
|
||||
for (MetaQueryPlan plan : capture.getPlans()) {
|
||||
log.info("queryPlan db:{} label:{} queryTimeMicros:{} loc:{} sql:{} bind:{} plan:{}",
|
||||
dbName, plan.getLabel(), plan.getQueryTimeMicros(), plan.getProfileLocation(),
|
||||
plan.getSql(), plan.getBind(), plan.getPlan());
|
||||
dbName, plan.label(), plan.queryTimeMicros(), plan.profileLocation(),
|
||||
plan.sql(), plan.bind(), plan.plan());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -416,8 +416,8 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
|
||||
private void collectQueryPlans() {
|
||||
QueryPlanRequest request = new QueryPlanRequest();
|
||||
request.setMaxCount(config.getQueryPlanCaptureMaxCount());
|
||||
request.setMaxTimeMillis(config.getQueryPlanCaptureMaxTimeMillis());
|
||||
request.maxCount(config.getQueryPlanCaptureMaxCount());
|
||||
request.maxTimeMillis(config.getQueryPlanCaptureMaxTimeMillis());
|
||||
|
||||
// obtains query explain plans ...
|
||||
List<MetaQueryPlan> plans = metaInfoManager.queryPlanCollectNow(request);
|
||||
@@ -2328,13 +2328,13 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
@Override
|
||||
public void visitMetrics(MetricVisitor visitor) {
|
||||
visitor.visitStart();
|
||||
if (visitor.isCollectTransactionMetrics()) {
|
||||
if (visitor.collectTransactionMetrics()) {
|
||||
transactionManager.visitMetrics(visitor);
|
||||
}
|
||||
if (visitor.isCollectL2Metrics()) {
|
||||
if (visitor.collectL2Metrics()) {
|
||||
serverCacheManager.visitMetrics(visitor);
|
||||
}
|
||||
if (visitor.isCollectQueryMetrics()) {
|
||||
if (visitor.collectQueryMetrics()) {
|
||||
beanDescriptorManager.visitMetrics(visitor);
|
||||
dtoBeanManager.visitMetrics(visitor);
|
||||
relationalQueryEngine.visitMetrics(visitor);
|
||||
@@ -2351,7 +2351,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
|
||||
List<MetaQueryPlan> queryPlanInit(QueryPlanInit initRequest) {
|
||||
if (initRequest.isAll()) {
|
||||
queryPlanManager.setDefaultThreshold(initRequest.getThresholdMicros());
|
||||
queryPlanManager.setDefaultThreshold(initRequest.thresholdMicros());
|
||||
}
|
||||
return beanDescriptorManager.queryPlanInit(initRequest);
|
||||
}
|
||||
|
||||
@@ -78,11 +78,11 @@ class DumpMetrics {
|
||||
out("-- Dumping metrics for " + server.getName() + " -- ");
|
||||
ServerMetrics serverMetrics = server.getMetaInfoManager().collectMetrics();
|
||||
|
||||
for (MetaTimedMetric metric : serverMetrics.getTimedMetrics()) {
|
||||
for (MetaTimedMetric metric : serverMetrics.timedMetrics()) {
|
||||
log(metric);
|
||||
}
|
||||
|
||||
List<MetaCountMetric> countMetrics = serverMetrics.getCountMetrics();
|
||||
List<MetaCountMetric> countMetrics = serverMetrics.countMetrics();
|
||||
if (!countMetrics.isEmpty()) {
|
||||
out("\n-- Counters --");
|
||||
countMetrics.sort(SortMetric.COUNT_NAME);
|
||||
@@ -91,7 +91,7 @@ class DumpMetrics {
|
||||
}
|
||||
}
|
||||
|
||||
List<MetaQueryMetric> queryMetrics = serverMetrics.getQueryMetrics();
|
||||
List<MetaQueryMetric> queryMetrics = serverMetrics.queryMetrics();
|
||||
if (!queryMetrics.isEmpty()) {
|
||||
out("\n-- Queries --");
|
||||
queryMetrics.sort(sortBy);
|
||||
@@ -104,8 +104,8 @@ class DumpMetrics {
|
||||
private void logCount(MetaCountMetric metric) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(padNameTimed(metric.getName())).append(" ");
|
||||
sb.append(" count:").append(pad(metric.getCount()));
|
||||
sb.append(padNameTimed(metric.name())).append(" ");
|
||||
sb.append(" count:").append(pad(metric.count()));
|
||||
out(sb.toString());
|
||||
}
|
||||
|
||||
@@ -120,38 +120,38 @@ class DumpMetrics {
|
||||
appendQueryName(metric, sb);
|
||||
appendCounters(metric, sb);
|
||||
if (dumpHash) {
|
||||
sb.append("\n sqlHash:").append(metric.getSqlHash());
|
||||
sb.append("\n sqlHash:").append(metric.sqlHash());
|
||||
}
|
||||
appendProfileAndSql(metric, sb);
|
||||
out(sb.toString());
|
||||
}
|
||||
|
||||
private void appendQueryName(MetaQueryMetric metric, StringBuilder sb) {
|
||||
sb.append("query:").append(padName(metric.getName())).append(" ");
|
||||
sb.append("query:").append(padName(metric.name())).append(" ");
|
||||
}
|
||||
|
||||
private void appendProfileAndSql(MetaQueryMetric metric, StringBuilder sb) {
|
||||
String location = metric.getLocation();
|
||||
String location = metric.location();
|
||||
if (dumpLoc && location != null) {
|
||||
sb.append("\n loc:").append(location);
|
||||
}
|
||||
if (dumpSql) {
|
||||
sb.append(" \n\n sql:").append(metric.getSql()).append("\n\n");
|
||||
sb.append(" \n\n sql:").append(metric.sql()).append("\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
private void log(MetaTimedMetric metric) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(padNameTimed(metric.getName())).append(" ");
|
||||
sb.append(padNameTimed(metric.name())).append(" ");
|
||||
appendCounters(metric, sb);
|
||||
out(sb.toString());
|
||||
}
|
||||
|
||||
private void appendCounters(MetaTimedMetric timedMetric, StringBuilder sb) {
|
||||
sb.append(" count:").append(pad(timedMetric.getCount()))
|
||||
.append(" total:").append(pad(timedMetric.getTotal()))
|
||||
.append(" mean:").append(pad(timedMetric.getMean()))
|
||||
.append(" max:").append(pad(timedMetric.getMax()));
|
||||
sb.append(" count:").append(pad(timedMetric.count()))
|
||||
.append(" total:").append(pad(timedMetric.total()))
|
||||
.append(" mean:").append(pad(timedMetric.mean()))
|
||||
.append(" max:").append(pad(timedMetric.max()));
|
||||
}
|
||||
|
||||
private String padName(String name) {
|
||||
|
||||
@@ -31,9 +31,9 @@ class DumpMetricsData {
|
||||
|
||||
private void collect(ServerMetrics serverMetrics) {
|
||||
|
||||
final List<MetaTimedMetric> timedMetrics = serverMetrics.getTimedMetrics();
|
||||
final List<MetaCountMetric> countMetrics = serverMetrics.getCountMetrics();
|
||||
final List<MetaQueryMetric> queryMetrics = serverMetrics.getQueryMetrics();
|
||||
final List<MetaTimedMetric> timedMetrics = serverMetrics.timedMetrics();
|
||||
final List<MetaCountMetric> countMetrics = serverMetrics.countMetrics();
|
||||
final List<MetaQueryMetric> queryMetrics = serverMetrics.queryMetrics();
|
||||
|
||||
for (MetaTimedMetric metric : timedMetrics) {
|
||||
add(metric);
|
||||
@@ -47,7 +47,7 @@ class DumpMetricsData {
|
||||
}
|
||||
|
||||
private MetricData create(MetaMetric metric) {
|
||||
MetricData data = new MetricData(metric.getName());
|
||||
MetricData data = new MetricData(metric.name());
|
||||
list.add(data);
|
||||
return data;
|
||||
}
|
||||
@@ -55,30 +55,30 @@ class DumpMetricsData {
|
||||
private void add(MetaTimedMetric metric) {
|
||||
final MetricData data = create(metric);
|
||||
appendCounters(data, metric);
|
||||
data.setLoc(metric.getLocation());
|
||||
data.setLoc(metric.location());
|
||||
}
|
||||
|
||||
private void addCount(MetaCountMetric metric) {
|
||||
final MetricData data = create(metric);
|
||||
data.setCount(metric.getCount());
|
||||
data.setCount(metric.count());
|
||||
}
|
||||
|
||||
private void addQuery(MetaQueryMetric metric) {
|
||||
final MetricData data = create(metric);
|
||||
appendCounters(data, metric);
|
||||
appendLocationAndSql(data, metric);
|
||||
data.setSqlHash(metric.getSqlHash());
|
||||
data.setSqlHash(metric.sqlHash());
|
||||
}
|
||||
|
||||
private void appendLocationAndSql(MetricData data, MetaQueryMetric metric) {
|
||||
data.setLoc(metric.getLocation());
|
||||
data.setSql(metric.getSql());
|
||||
data.setLoc(metric.location());
|
||||
data.setSql(metric.sql());
|
||||
}
|
||||
|
||||
private void appendCounters(MetricData data, MetaTimedMetric timedMetric) {
|
||||
data.setCount(timedMetric.getCount());
|
||||
data.setTotal(timedMetric.getTotal());
|
||||
data.setMean(timedMetric.getMean());
|
||||
data.setMax(timedMetric.getMax());
|
||||
data.setCount(timedMetric.count());
|
||||
data.setTotal(timedMetric.total());
|
||||
data.setMean(timedMetric.mean());
|
||||
data.setMax(timedMetric.max());
|
||||
}
|
||||
}
|
||||
@@ -84,11 +84,11 @@ class DumpMetricsJson implements ServerMetricsAsJson {
|
||||
private void collect(ServerMetrics serverMetrics) {
|
||||
try {
|
||||
start();
|
||||
for (MetaTimedMetric metric : serverMetrics.getTimedMetrics()) {
|
||||
for (MetaTimedMetric metric : serverMetrics.timedMetrics()) {
|
||||
logTimed(metric);
|
||||
}
|
||||
|
||||
List<MetaCountMetric> countMetrics = serverMetrics.getCountMetrics();
|
||||
List<MetaCountMetric> countMetrics = serverMetrics.countMetrics();
|
||||
if (!countMetrics.isEmpty()) {
|
||||
if (sortBy != null) {
|
||||
countMetrics.sort(SortMetric.COUNT_NAME);
|
||||
@@ -98,7 +98,7 @@ class DumpMetricsJson implements ServerMetricsAsJson {
|
||||
}
|
||||
}
|
||||
|
||||
List<MetaQueryMetric> queryMetrics = serverMetrics.getQueryMetrics();
|
||||
List<MetaQueryMetric> queryMetrics = serverMetrics.queryMetrics();
|
||||
if (!queryMetrics.isEmpty()) {
|
||||
if (sortBy != null) {
|
||||
queryMetrics.sort(sortBy);
|
||||
@@ -170,7 +170,7 @@ class DumpMetricsJson implements ServerMetricsAsJson {
|
||||
}
|
||||
objStart();
|
||||
key("name");
|
||||
val(metric.getName());
|
||||
val(metric.name());
|
||||
}
|
||||
|
||||
private void metricEnd() throws IOException {
|
||||
@@ -180,7 +180,7 @@ class DumpMetricsJson implements ServerMetricsAsJson {
|
||||
private void logCount(MetaCountMetric metric) throws IOException {
|
||||
metricStart(metric);
|
||||
key("count");
|
||||
val(metric.getCount());
|
||||
val(metric.count());
|
||||
metricEnd();
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ class DumpMetricsJson implements ServerMetricsAsJson {
|
||||
metricStart(metric);
|
||||
appendTiming(metric);
|
||||
if (isIncludeDetail(metric)) {
|
||||
appendExtra("loc", metric.getLocation());
|
||||
appendExtra("loc", metric.location());
|
||||
}
|
||||
metricEnd();
|
||||
}
|
||||
@@ -197,11 +197,11 @@ class DumpMetricsJson implements ServerMetricsAsJson {
|
||||
metricStart(metric);
|
||||
appendTiming(metric);
|
||||
if (withHash) {
|
||||
keyVal("sqlHash", metric.getSqlHash());
|
||||
keyVal("sqlHash", metric.sqlHash());
|
||||
}
|
||||
if (isIncludeDetail(metric)) {
|
||||
appendExtra("loc", metric.getLocation());
|
||||
appendExtra("sql", metric.getSql());
|
||||
appendExtra("loc", metric.location());
|
||||
appendExtra("sql", metric.sql());
|
||||
}
|
||||
metricEnd();
|
||||
}
|
||||
@@ -218,10 +218,10 @@ class DumpMetricsJson implements ServerMetricsAsJson {
|
||||
}
|
||||
|
||||
private void appendTiming(MetaTimedMetric timedMetric) throws IOException {
|
||||
keyVal("count", timedMetric.getCount());
|
||||
keyVal("total", timedMetric.getTotal());
|
||||
keyVal("mean", timedMetric.getMean());
|
||||
keyVal("max", timedMetric.getMax());
|
||||
keyVal("count", timedMetric.count());
|
||||
keyVal("total", timedMetric.total());
|
||||
keyVal("mean", timedMetric.mean());
|
||||
keyVal("max", timedMetric.max());
|
||||
}
|
||||
|
||||
private void keyVal(String key, long value) throws IOException {
|
||||
|
||||
@@ -1559,7 +1559,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
void queryPlanInit(QueryPlanInit request, List<MetaQueryPlan> list) {
|
||||
for (CQueryPlan queryPlan : queryPlanCache.values()) {
|
||||
if (request.includeHash(queryPlan.getSqlHash())) {
|
||||
queryPlan.queryPlanInit(request.getThresholdMicros());
|
||||
queryPlan.queryPlanInit(request.thresholdMicros());
|
||||
list.add(queryPlan.createMeta(null, null));
|
||||
}
|
||||
}
|
||||
@@ -1572,7 +1572,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
iudMetrics.visit(visitor);
|
||||
for (CQueryPlan queryPlan : queryPlanCache.values()) {
|
||||
if (!queryPlan.isEmptyStats()) {
|
||||
visitor.visitQuery(queryPlan.getSnapshot(visitor.isReset()));
|
||||
visitor.visitQuery(queryPlan.getSnapshot(visitor.reset()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class DCountMetric implements CountMetric {
|
||||
@Override
|
||||
public void visit(MetricVisitor visitor) {
|
||||
|
||||
long val = visitor.isReset() ? count.sumThenReset() : count.sum();
|
||||
long val = visitor.reset() ? count.sumThenReset() : count.sum();
|
||||
if (val > 0) {
|
||||
visitor.visitCount(new DCountMetricStats(name, val));
|
||||
}
|
||||
@@ -66,12 +66,12 @@ class DCountMetric implements CountMetric {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getCount() {
|
||||
public long count() {
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class DQueryPlanMetric implements QueryPlanMetric {
|
||||
|
||||
@Override
|
||||
public void visit(MetricVisitor visitor) {
|
||||
TimedMetricStats stats = metric.collect(visitor.isReset());
|
||||
TimedMetricStats stats = metric.collect(visitor.reset());
|
||||
if (stats != null) {
|
||||
visitor.visitQuery(new Stats(meta, stats, collected));
|
||||
collected = true;
|
||||
@@ -45,11 +45,11 @@ class DQueryPlanMetric implements QueryPlanMetric {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return meta + " " + stats + " sql:" + getSql();
|
||||
return meta + " " + stats + " sql:" + sql();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getType() {
|
||||
public Class<?> type() {
|
||||
return meta.getType();
|
||||
}
|
||||
|
||||
@@ -59,48 +59,48 @@ class DQueryPlanMetric implements QueryPlanMetric {
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSqlHash() {
|
||||
public long sqlHash() {
|
||||
return meta.getSqlHash();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
public String label() {
|
||||
return meta.getLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSql() {
|
||||
public String sql() {
|
||||
return meta.getSql();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
public String name() {
|
||||
return meta.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocation() {
|
||||
public String location() {
|
||||
return meta.getLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getCount() {
|
||||
return stats.getCount();
|
||||
public long count() {
|
||||
return stats.count();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTotal() {
|
||||
return stats.getTotal();
|
||||
public long total() {
|
||||
return stats.total();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMax() {
|
||||
return stats.getMax();
|
||||
public long max() {
|
||||
return stats.max();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMean() {
|
||||
return stats.getMean();
|
||||
public long mean() {
|
||||
return stats.mean();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,12 +60,12 @@ class DTimeMetricStats implements TimedMetricStats {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocation() {
|
||||
public String location() {
|
||||
return location;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ class DTimeMetricStats implements TimedMetricStats {
|
||||
* Return the count of values collected.
|
||||
*/
|
||||
@Override
|
||||
public long getCount() {
|
||||
public long count() {
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class DTimeMetricStats implements TimedMetricStats {
|
||||
* Return the total of all the values.
|
||||
*/
|
||||
@Override
|
||||
public long getTotal() {
|
||||
public long total() {
|
||||
return total;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class DTimeMetricStats implements TimedMetricStats {
|
||||
* Return the Max value collected.
|
||||
*/
|
||||
@Override
|
||||
public long getMax() {
|
||||
public long max() {
|
||||
return max;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ class DTimeMetricStats implements TimedMetricStats {
|
||||
* Return the mean value rounded up.
|
||||
*/
|
||||
@Override
|
||||
public long getMean() {
|
||||
public long mean() {
|
||||
return (count < 1) ? 0L : Math.round((double)(total / count));
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ class DTimedMetric implements TimedMetric {
|
||||
|
||||
@Override
|
||||
public void visit(MetricVisitor visitor) {
|
||||
DTimeMetricStats metric = collect(visitor.isReset());
|
||||
DTimeMetricStats metric = collect(visitor.reset());
|
||||
if (metric != null) {
|
||||
visitor.visitTimed(metric);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class DTimedProfileLocation extends DProfileLocation implements TimedProfileLoca
|
||||
|
||||
@Override
|
||||
public void visit(MetricVisitor visitor) {
|
||||
TimedMetricStats collect = timedMetric.collect(visitor.isReset());
|
||||
TimedMetricStats collect = timedMetric.collect(visitor.reset());
|
||||
if (collect != null) {
|
||||
if (overrideMetricName) {
|
||||
collect.setName(fullName);
|
||||
|
||||
@@ -24,10 +24,10 @@ class CQueryPlanRequest {
|
||||
CQueryPlanRequest(Connection connection, QueryPlanRequest req, Iterator<CQueryBindCapture> iterator) {
|
||||
this.connection = connection;
|
||||
this.iterator = iterator;
|
||||
this.maxCount = req.getMaxCount();
|
||||
long reqSince = req.getSince();
|
||||
this.maxCount = req.maxCount();
|
||||
long reqSince = req.since();
|
||||
this.since = (reqSince == 0) ? Long.MAX_VALUE: reqSince;
|
||||
long maxTimeMillis = req.getMaxTimeMillis();
|
||||
long maxTimeMillis = req.maxTimeMillis();
|
||||
this.maxTime = maxTimeMillis > 0 ? System.currentTimeMillis() + maxTimeMillis : 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,56 +83,56 @@ public final class CQueryPlanStats {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "label:" + getLabel() + " location:" + getLocation() + " metrics:" + metrics + " sql:" + getSql();
|
||||
return "label:" + label() + " location:" + location() + " metrics:" + metrics + " sql:" + sql();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getType() {
|
||||
public Class<?> type() {
|
||||
return queryPlan.getBeanType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
public String label() {
|
||||
return queryPlan.getLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
public String name() {
|
||||
return queryPlan.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocation() {
|
||||
public String location() {
|
||||
return queryPlan.getLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getCount() {
|
||||
return metrics.getCount();
|
||||
public long count() {
|
||||
return metrics.count();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTotal() {
|
||||
return metrics.getTotal();
|
||||
public long total() {
|
||||
return metrics.total();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMax() {
|
||||
return metrics.getMax();
|
||||
public long max() {
|
||||
return metrics.max();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMean() {
|
||||
return metrics.getMean();
|
||||
public long mean() {
|
||||
return metrics.mean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSqlHash() {
|
||||
public long sqlHash() {
|
||||
return queryPlan.getSqlHash();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSql() {
|
||||
public String sql() {
|
||||
return queryPlan.getSql();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,14 +16,14 @@ class DQueryPlanOutput implements MetaQueryPlan, SpiDbQueryPlan {
|
||||
private final String sql;
|
||||
private final String bind;
|
||||
private final String plan;
|
||||
private final long hash;
|
||||
private final long sqlHash;
|
||||
private long queryTimeMicros;
|
||||
private long captureCount;
|
||||
|
||||
DQueryPlanOutput(Class<?> beanType, String label, long hash, String sql, ProfileLocation profileLocation, String bind, String plan) {
|
||||
DQueryPlanOutput(Class<?> beanType, String label, long sqlHash, String sql, ProfileLocation profileLocation, String bind, String plan) {
|
||||
this.beanType = beanType;
|
||||
this.label = label;
|
||||
this.hash = hash;
|
||||
this.sqlHash = sqlHash;
|
||||
this.sql = sql;
|
||||
this.profileLocation = profileLocation;
|
||||
this.bind = bind;
|
||||
@@ -31,15 +31,15 @@ class DQueryPlanOutput implements MetaQueryPlan, SpiDbQueryPlan {
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getHash() {
|
||||
return hash;
|
||||
public long sqlHash() {
|
||||
return sqlHash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the associated bean.
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getBeanType() {
|
||||
public Class<?> beanType() {
|
||||
return beanType;
|
||||
}
|
||||
|
||||
@@ -47,12 +47,12 @@ class DQueryPlanOutput implements MetaQueryPlan, SpiDbQueryPlan {
|
||||
* Return the query label if set.
|
||||
*/
|
||||
@Override
|
||||
public String getLabel() {
|
||||
public String label() {
|
||||
return label;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProfileLocation getProfileLocation() {
|
||||
public ProfileLocation profileLocation() {
|
||||
return profileLocation;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ class DQueryPlanOutput implements MetaQueryPlan, SpiDbQueryPlan {
|
||||
* Return the sql of query.
|
||||
*/
|
||||
@Override
|
||||
public String getSql() {
|
||||
public String sql() {
|
||||
return sql;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class DQueryPlanOutput implements MetaQueryPlan, SpiDbQueryPlan {
|
||||
* Return a description of the bind values used.
|
||||
*/
|
||||
@Override
|
||||
public String getBind() {
|
||||
public String bind() {
|
||||
return bind;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ class DQueryPlanOutput implements MetaQueryPlan, SpiDbQueryPlan {
|
||||
* Return the query plan.
|
||||
*/
|
||||
@Override
|
||||
public String getPlan() {
|
||||
public String plan() {
|
||||
return plan;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ class DQueryPlanOutput implements MetaQueryPlan, SpiDbQueryPlan {
|
||||
* to build the query plan.
|
||||
*/
|
||||
@Override
|
||||
public long getQueryTimeMicros() {
|
||||
public long queryTimeMicros() {
|
||||
return queryTimeMicros;
|
||||
}
|
||||
|
||||
@@ -93,13 +93,13 @@ class DQueryPlanOutput implements MetaQueryPlan, SpiDbQueryPlan {
|
||||
* Return the total count of times bind capture has occurred.
|
||||
*/
|
||||
@Override
|
||||
public long getCaptureCount() {
|
||||
public long captureCount() {
|
||||
return captureCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return " BeanType:" + ((beanType == null) ? "" : beanType.getSimpleName()) + " planHash:" + hash + " label:" + label + " queryTimeMicros:" + queryTimeMicros + " captureCount:" + captureCount + "\n SQL:" + sql + "\nBIND:" + bind + "\nPLAN:" + plan;
|
||||
return " BeanType:" + ((beanType == null) ? "" : beanType.getSimpleName()) + " planHash:" + sqlHash + " label:" + label + " queryTimeMicros:" + queryTimeMicros + " captureCount:" + captureCount + "\n SQL:" + sql + "\nBIND:" + bind + "\nPLAN:" + plan;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user