Search in sources :

Example 1 with ExceededCpuLimitException

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));
        }
    }
}
Also used : Duration(io.airlift.units.Duration) ExceededCpuLimitException(io.prestosql.ExceededCpuLimitException)

Aggregations

Duration (io.airlift.units.Duration)1 ExceededCpuLimitException (io.prestosql.ExceededCpuLimitException)1