本文整理了Java中org.apache.kylin.common.QueryContextFacade
类的一些代码示例,展示了QueryContextFacade
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryContextFacade
类的具体详情如下:
包路径:org.apache.kylin.common.QueryContextFacade
类名称:QueryContextFacade
暂无
代码示例来源:origin: apache/kylin
public CubeHBaseRPC(ISegment segment, Cuboid cuboid, GTInfo fullGTInfo, StorageContext context) {
Preconditions.checkArgument(segment instanceof CubeSegment, "segment must be CubeSegment");
this.cubeSeg = (CubeSegment) segment;
this.cuboid = cuboid;
this.fullGTInfo = fullGTInfo;
this.queryContext = QueryContextFacade.current();
this.storageContext = context;
this.fuzzyKeyEncoder = new FuzzyKeyEncoder(cubeSeg, cuboid);
this.fuzzyMaskEncoder = new FuzzyMaskEncoder(cubeSeg, cuboid);
}
代码示例来源:origin: apache/kylin
/**
*
* @param runTimeMoreThan in seconds
* @return
*/
@RequestMapping(value = "/query/runningQueries", method = RequestMethod.GET)
@ResponseBody
public TreeSet<QueryContext> getRunningQueries(
@RequestParam(value = "runTimeMoreThan", required = false, defaultValue = "-1") int runTimeMoreThan) {
if (runTimeMoreThan == -1) {
return QueryContextFacade.getAllRunningQueries();
} else {
return QueryContextFacade.getLongRunningQueries(runTimeMoreThan * 1000);
}
}
代码示例来源:origin: apache/kylin
@RequestMapping(value = "/query/{queryId}/stop", method = RequestMethod.PUT)
@ResponseBody
public void stopQuery(@PathVariable String queryId) {
final String user = SecurityContextHolder.getContext().getAuthentication().getName();
logger.info("{} tries to stop the query: {}, but not guaranteed to succeed.", user, queryId);
QueryContextFacade.stopQuery(queryId, "stopped by " + user);
}
代码示例来源:origin: apache/kylin
BackdoorToggles.addToggles(sqlRequest.getBackdoorToggles());
final QueryContext queryContext = QueryContextFacade.current();
QueryContextFacade.resetCurrent();
代码示例来源:origin: apache/kylin
/**
* @param runningTime in milliseconds
* @return running queries that have run more than specified time
*/
public static TreeSet<QueryContext> getLongRunningQueries(long runningTime) {
SortedSet<QueryContext> allRunningQueries = getAllRunningQueries();
QueryContext tmpCtx = new QueryContext(runningTime + 1L); // plus 1 to include those contexts in same accumulatedMills but different uuid
return (TreeSet<QueryContext>) allRunningQueries.headSet(tmpCtx);
}
}
代码示例来源:origin: org.apache.kylin/kylin-core-common
/**
* @param runningTime in milliseconds
* @return running queries that have run more than specified time
*/
public static TreeSet<QueryContext> getLongRunningQueries(long runningTime) {
SortedSet<QueryContext> allRunningQueries = getAllRunningQueries();
QueryContext tmpCtx = new QueryContext(runningTime + 1L); // plus 1 to include those contexts in same accumulatedMills but different uuid
return (TreeSet<QueryContext>) allRunningQueries.headSet(tmpCtx);
}
}
代码示例来源:origin: apache/kylin
@Override
public ITuple next() {
if (scanCount++ % 100 == 1) {
QueryContextFacade.current().checkMillisBeforeDeadline();
}
if (++scanCountDelta >= 1000) {
flushScanCountDelta();
}
return tupleIterator.next();
}
代码示例来源:origin: apache/kylin
public OLAPQuery(DataContext optiqContext, EnumeratorTypeEnum type, int ctxId) {
this.optiqContext = optiqContext;
this.type = type;
this.contextId = ctxId;
QueryContextFacade.current().addContext(ctxId, type.toString(),
type == EnumeratorTypeEnum.OLAP);
}
代码示例来源:origin: apache/kylin
StringBuilder cubeSb = new StringBuilder();
StringBuilder logSb = new StringBuilder("Processed rows for each storageContext: ");
QueryContext queryContext = QueryContextFacade.current();
if (OLAPContext.getThreadLocalContexts() != null) { // contexts can be null in case of 'explain plan for'
for (OLAPContext ctx : OLAPContext.getThreadLocalContexts()) {
代码示例来源:origin: apache/kylin
QueryContextFacade.current().checkMillisBeforeDeadline();
代码示例来源:origin: apache/kylin
System.out.println("EXECUTION PLAN AFTER REWRITE");
System.out.println(dumpPlan);
QueryContextFacade.current().setCalcitePlan(this.copy(getTraitSet(), getInputs()));
代码示例来源:origin: apache/kylin
conn = QueryConnection.getConnection(sqlRequest.getProject());
String userInfo = SecurityContextHolder.getContext().getAuthentication().getName();
QueryContext context = QueryContextFacade.current();
context.setUsername(userInfo);
context.setGroups(AclPermissionUtil.getCurrentUserGroups());
代码示例来源:origin: apache/kylin
private SQLResponse queryAndUpdateCache(SQLRequest sqlRequest, boolean queryCacheEnabled) {
KylinConfig kylinConfig = KylinConfig.getInstanceFromEnv();
Message msg = MsgPicker.getMsg();
final QueryContext queryContext = QueryContextFacade.current();
代码示例来源:origin: apache/kylin
user = "unknown";
for (QueryContext.RPCStatistics entry : QueryContextFacade.current().getRpcStatisticsList()) {
RecordEvent rpcMetricsEvent = new TimedRecordEvent(
KylinConfig.getInstanceFromEnv().getKylinMetricsSubjectQueryRpcCall());
代码示例来源:origin: org.apache.kylin/kylin-storage-hbase
public CubeHBaseRPC(ISegment segment, Cuboid cuboid, GTInfo fullGTInfo, StorageContext context) {
Preconditions.checkArgument(segment instanceof CubeSegment, "segment must be CubeSegment");
this.cubeSeg = (CubeSegment) segment;
this.cuboid = cuboid;
this.fullGTInfo = fullGTInfo;
this.queryContext = QueryContextFacade.current();
this.storageContext = context;
this.fuzzyKeyEncoder = new FuzzyKeyEncoder(cubeSeg, cuboid);
this.fuzzyMaskEncoder = new FuzzyMaskEncoder(cubeSeg, cuboid);
}
代码示例来源:origin: org.apache.kylin/kylin-core-storage
@Override
public ITuple next() {
if (scanCount++ % 100 == 1) {
QueryContextFacade.current().checkMillisBeforeDeadline();
}
if (++scanCountDelta >= 1000) {
flushScanCountDelta();
}
return tupleIterator.next();
}
代码示例来源:origin: org.apache.kylin/kylin-query
public OLAPQuery(DataContext optiqContext, EnumeratorTypeEnum type, int ctxId) {
this.optiqContext = optiqContext;
this.type = type;
this.contextId = ctxId;
QueryContextFacade.current().addContext(ctxId, type.toString(),
type == EnumeratorTypeEnum.OLAP);
}
代码示例来源:origin: org.apache.kylin/kylin-core-storage
QueryContextFacade.current().checkMillisBeforeDeadline();
代码示例来源:origin: org.apache.kylin/kylin-query
System.out.println("EXECUTION PLAN AFTER REWRITE");
System.out.println(dumpPlan);
QueryContextFacade.current().setCalcitePlan(this.copy(getTraitSet(), getInputs()));
内容来源于网络,如有侵权,请联系作者删除!