本文整理汇总了Java中org.apache.kylin.rest.response.SQLResponse.isHitExceptionCache方法的典型用法代码示例。如果您正苦于以下问题:Java SQLResponse.isHitExceptionCache方法的具体用法?Java SQLResponse.isHitExceptionCache怎么用?Java SQLResponse.isHitExceptionCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.kylin.rest.response.SQLResponse
的用法示例。
在下文中一共展示了SQLResponse.isHitExceptionCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: incrQueryCount
import org.apache.kylin.rest.response.SQLResponse; //导入方法依赖的package包/类
private static void incrQueryCount(QueryMetrics queryMetrics, SQLResponse sqlResponse) {
if (!sqlResponse.isHitExceptionCache() && !sqlResponse.getIsException()) {
queryMetrics.incrQuerySuccessCount();
} else {
queryMetrics.incrQueryFailCount();
}
queryMetrics.incrQueryCount();
}
示例2: incrQueryCount
import org.apache.kylin.rest.response.SQLResponse; //导入方法依赖的package包/类
private static void incrQueryCount(String name, SQLResponse sqlResponse) {
if (!sqlResponse.isHitExceptionCache() && !sqlResponse.getIsException()) {
metrics.incrementCounter(MetricsNameBuilder.buildMetricName(name, MetricsConstant.QUERY_SUCCESS_COUNT));
} else {
metrics.incrementCounter(MetricsNameBuilder.buildMetricName(name, MetricsConstant.QUERY_FAIL_COUNT));
}
metrics.incrementCounter(MetricsNameBuilder.buildMetricName(name, MetricsConstant.QUERY_COUNT));
}
示例3: logQuery
import org.apache.kylin.rest.response.SQLResponse; //导入方法依赖的package包/类
public void logQuery(final SQLRequest request, final SQLResponse response) {
final String user = aclEvaluate.getCurrentUserName();
final List<String> realizationNames = new LinkedList<>();
final Set<Long> cuboidIds = new HashSet<Long>();
float duration = response.getDuration() / (float) 1000;
boolean storageCacheUsed = response.isStorageCacheUsed();
boolean isPushDown = response.isPushDown();
if (!response.isHitExceptionCache() && null != OLAPContext.getThreadLocalContexts()) {
for (OLAPContext ctx : OLAPContext.getThreadLocalContexts()) {
Cuboid cuboid = ctx.storageContext.getCuboid();
if (cuboid != null) {
//Some queries do not involve cuboid, e.g. lookup table query
cuboidIds.add(cuboid.getId());
}
if (ctx.realization != null) {
realizationNames.add(ctx.realization.getCanonicalName());
}
}
}
int resultRowCount = 0;
if (!response.getIsException() && response.getResults() != null) {
resultRowCount = response.getResults().size();
}
String newLine = System.getProperty("line.separator");
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(newLine);
stringBuilder.append("==========================[QUERY]===============================").append(newLine);
stringBuilder.append("Query Id: ").append(QueryContext.current().getQueryId()).append(newLine);
stringBuilder.append("SQL: ").append(request.getSql()).append(newLine);
stringBuilder.append("User: ").append(user).append(newLine);
stringBuilder.append("Success: ").append((null == response.getExceptionMessage())).append(newLine);
stringBuilder.append("Duration: ").append(duration).append(newLine);
stringBuilder.append("Project: ").append(request.getProject()).append(newLine);
stringBuilder.append("Realization Names: ").append(realizationNames).append(newLine);
stringBuilder.append("Cuboid Ids: ").append(cuboidIds).append(newLine);
stringBuilder.append("Total scan count: ").append(response.getTotalScanCount()).append(newLine);
stringBuilder.append("Total scan bytes: ").append(response.getTotalScanBytes()).append(newLine);
stringBuilder.append("Result row count: ").append(resultRowCount).append(newLine);
stringBuilder.append("Accept Partial: ").append(request.isAcceptPartial()).append(newLine);
stringBuilder.append("Is Partial Result: ").append(response.isPartial()).append(newLine);
stringBuilder.append("Hit Exception Cache: ").append(response.isHitExceptionCache()).append(newLine);
stringBuilder.append("Storage cache used: ").append(storageCacheUsed).append(newLine);
stringBuilder.append("Is Query Push-Down: ").append(isPushDown).append(newLine);
stringBuilder.append("Trace URL: ").append(response.getTraceUrl()).append(newLine);
stringBuilder.append("Message: ").append(response.getExceptionMessage()).append(newLine);
stringBuilder.append("==========================[QUERY]===============================").append(newLine);
logger.info(stringBuilder.toString());
}