use of io.prestosql.operator.ExchangeClient in project hetu-core by openlookeng.
the class ExecutingStatementResource method getQuery.
protected Query getQuery(QueryId queryId, String slug) {
Query query = queries.get(queryId);
if (query != null) {
if (!query.isSlugValid(slug)) {
throw badRequest(NOT_FOUND, "Query not found");
}
return query;
}
// this is the first time the query has been accessed on this coordinator
Session session;
try {
if (!queryManager.isQuerySlugValid(queryId, slug)) {
throw badRequest(NOT_FOUND, "Query not found");
}
session = queryManager.getQuerySession(queryId);
} catch (NoSuchElementException e) {
throw badRequest(NOT_FOUND, "Query not found");
}
query = queries.computeIfAbsent(queryId, id -> {
ExchangeClient exchangeClient = exchangeClientSupplier.get(new SimpleLocalMemoryContext(newSimpleAggregatedMemoryContext(), ExecutingStatementResource.class.getSimpleName()));
if (SystemSessionProperties.isSnapshotEnabled(session)) {
exchangeClient.setSnapshotEnabled(snapshotUtils.getOrCreateQuerySnapshotManager(queryId, session));
}
return Query.create(session, slug, queryManager, exchangeClient, responseExecutor, timeoutExecutor, blockEncodingSerde);
});
return query;
}
use of io.prestosql.operator.ExchangeClient in project hetu-core by openlookeng.
the class PagePublisherQueryRunner method getQuery.
private Query getQuery(QueryId queryId, String slug) {
// this is the first time the query has been accessed on this coordinator
Session session;
try {
if (!queryManager.isQuerySlugValid(queryId, slug)) {
throw badRequest(NOT_FOUND, "Query not found");
}
session = queryManager.getQuerySession(queryId);
} catch (NoSuchElementException e) {
throw badRequest(NOT_FOUND, "Query not found");
}
ExchangeClient exchangeClient = this.exchangeClientSupplier.get(new SimpleLocalMemoryContext(newSimpleAggregatedMemoryContext(), DataCenterStatementResource.class.getSimpleName()));
return Query.create(session, slug, queryManager, exchangeClient, executor, timeoutExecutor, blockEncodingSerde);
}
use of io.prestosql.operator.ExchangeClient in project hetu-core by openlookeng.
the class AutoVacuumScanner method getQuery.
private synchronized Query getQuery(QueryId queryId, String slug) {
// this is the first time the query has been accessed on this coordinator
Session session = null;
try {
if (!queryManager.isQuerySlugValid(queryId, slug)) {
return null;
}
session = queryManager.getQuerySession(queryId);
if (null == session) {
return null;
}
} catch (NoSuchElementException e) {
return null;
}
ExchangeClient exchangeClient = this.exchangeClientSupplier.get(new SimpleLocalMemoryContext(newSimpleAggregatedMemoryContext(), DataCenterStatementResource.class.getSimpleName()));
return Query.create(session, slug, queryManager, exchangeClient, directExecutor(), timeoutExecutor, blockEncodingSerde);
}
Aggregations