#411 - Refactor AutoFetch, rename to "AutoTune", store/load tuning and profiling as XML

This commit is contained in:
Robin Bygrave committed 2015-09-10 23:20:57 +12:00
1 parent 9632279c2f
commit 0a8c902790
111 files changed
+255 -341

No files matched your search

@@ -13,7 +13,7 @@ import com.avaje.ebean.event.readaudit.ReadEvent;
import com.avaje.ebeaninternal.api.SpiQuery;
import com.avaje.ebeaninternal.api.SpiQuery.Mode;
import com.avaje.ebeaninternal.api.SpiTransaction;
import com.avaje.ebeaninternal.server.autofetch.ProfilingListener;
import com.avaje.ebeaninternal.server.autotune.ProfilingListener;
import com.avaje.ebeaninternal.server.core.Message;
import com.avaje.ebeaninternal.server.core.OrmQueryRequest;
import com.avaje.ebeaninternal.server.core.SpiOrmQueryRequest;
@@ -673,7 +673,7 @@ public class CQuery<T> implements DbReadContext, CancelableQuery {
* This is true for all queries except lazy load bean queries.
* </p>
*/
public boolean isAutoFetchProfiling() {
public boolean isAutoTuneProfiling() {
// need query.isProfiling() because we just take the data
// from the lazy loaded or refreshed beans and put it into the already
// existing beans which are already collecting usage information
@@ -404,7 +404,7 @@ public class CQueryEngine {
msg.append("mode[").append(loadMode).append("] ");
}
msg.append("type[").append(q.getBeanName()).append("] ");
if (query.isAutofetchTuned()) {
if (query.isAutoTuned()) {
msg.append("tuned[true] ");
}
if (originKey != null) {
@@ -447,7 +447,7 @@ public class CQueryEngine {
msg.append("mode[").append(loadMode).append("] ");
}
msg.append("type[").append(q.getBeanName()).append("] ");
if (query.isAutofetchTuned()) {
if (query.isAutoTuned()) {
msg.append("tuned[true] ");
}
if (originKey != null) {
@@ -250,7 +250,7 @@ public class CQueryFetchIds {
return null;
}
public boolean isAutoFetchProfiling() {
public boolean isAutoTuneProfiling() {
return false;
}
@@ -43,7 +43,7 @@ public class CQueryPlan {
private final SpiEbeanServer server;
private final boolean autofetchTuned;
private final boolean autoTuned;
private final HashQueryPlan hash;
@@ -80,7 +80,7 @@ public class CQueryPlan {
this.beanType = request.getBeanDescriptor().getBeanType();
this.stats = new CQueryPlanStats(this, server.isCollectQueryOrigins());
this.hash = request.getQueryPlanHash();
this.autofetchTuned = request.getQuery().isAutofetchTuned();
this.autoTuned = request.getQuery().isAutoTuned();
if (sqlRes != null) {
this.sql = sqlRes.getSql();
this.rowNumberIncluded = sqlRes.isIncludesRowNumberColumn();
@@ -104,7 +104,7 @@ public class CQueryPlan {
this.beanType = request.getBeanDescriptor().getBeanType();
this.stats = new CQueryPlanStats(this, server.isCollectQueryOrigins());
this.hash = buildHash(sql, rawSql, rowNumberIncluded, logWhereSql);
this.autofetchTuned = false;
this.autoTuned = false;
this.sql = sql;
this.sqlTree = sqlTree;
this.rawSql = rawSql;
@@ -143,8 +143,8 @@ public class CQueryPlan {
}
}
public boolean isAutofetchTuned() {
return autofetchTuned;
public boolean isAutoTuned() {
return autoTuned;
}
public HashQueryPlan getHash() {
@@ -226,8 +226,8 @@ public final class CQueryPlanStats {
}
@Override
public boolean isAutofetchTuned() {
return queryPlan.isAutofetchTuned();
public boolean isAutoTuned() {
return queryPlan.isAutoTuned();
}
@@ -326,8 +326,8 @@ public class SqlTreeNodeBean implements SqlTreeNode {
ebi.setFullyLoadedBean(true);
}
if (ctx.isAutoFetchProfiling() && !disableLazyLoad) {
// collect autofetch profiling for this bean...
if (ctx.isAutoTuneProfiling() && !disableLazyLoad) {
// collect autoTune profiling for this bean...
ctx.profileBean(ebi, prefix);
}
}