当前位置: 首页>>代码示例>>Java>>正文


Java SQLResponse.isHitExceptionCache方法代码示例

本文整理汇总了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();
}
 
开发者ID:apache,项目名称:kylin,代码行数:9,代码来源:QueryMetricsFacade.java

示例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));
}
 
开发者ID:apache,项目名称:kylin,代码行数:9,代码来源:QueryMetrics2Facade.java

示例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());
}
 
开发者ID:apache,项目名称:kylin,代码行数:55,代码来源:QueryService.java


注:本文中的org.apache.kylin.rest.response.SQLResponse.isHitExceptionCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。