use of io.prestosql.ExceededCpuLimitException in project hetu-core by openlookeng.
the class SqlQueryManager method enforceCpuLimits.
/**
* Enforce query CPU time limits
*/
private void enforceCpuLimits() {
for (QueryExecution query : queryTracker.getAllQueries()) {
Duration cpuTime = query.getTotalCpuTime();
Duration sessionLimit = getQueryMaxCpuTime(query.getSession());
Duration limit = Ordering.natural().min(maxQueryCpuTime, sessionLimit);
if (cpuTime.compareTo(limit) > 0) {
query.fail(new ExceededCpuLimitException(limit));
}
}
}
Aggregations