use of io.trino.spi.block.BlockEncodingSerde in project trino by trinodb.
the class TestBinaryFileSpiller method setUp.
@BeforeMethod
public void setUp() {
spillerStats = new SpillerStats();
FeaturesConfig featuresConfig = new FeaturesConfig();
featuresConfig.setSpillerSpillPaths(spillPath.getAbsolutePath());
featuresConfig.setSpillMaxUsedSpaceThreshold(1.0);
NodeSpillConfig nodeSpillConfig = new NodeSpillConfig();
BlockEncodingSerde blockEncodingSerde = new TestingBlockEncodingSerde();
singleStreamSpillerFactory = new FileSingleStreamSpillerFactory(blockEncodingSerde, spillerStats, featuresConfig, nodeSpillConfig);
factory = new GenericSpillerFactory(singleStreamSpillerFactory);
PagesSerdeFactory pagesSerdeFactory = new PagesSerdeFactory(blockEncodingSerde, nodeSpillConfig.isSpillCompressionEnabled());
pagesSerde = pagesSerdeFactory.createPagesSerde();
memoryContext = newSimpleAggregatedMemoryContext();
}
use of io.trino.spi.block.BlockEncodingSerde in project trino by trinodb.
the class ExecutingStatementResource method getQuery.
protected Query getQuery(QueryId queryId, String slug, long token) {
Query query = queries.get(queryId);
if (query != null) {
if (!query.isSlugValid(slug, token)) {
throw queryNotFound();
}
return query;
}
// this is the first time the query has been accessed on this coordinator
Session session;
Slug querySlug;
try {
session = queryManager.getQuerySession(queryId);
querySlug = queryManager.getQuerySlug(queryId);
if (!querySlug.isValid(EXECUTING_QUERY, slug, token)) {
throw queryNotFound();
}
} catch (NoSuchElementException e) {
throw queryNotFound();
}
query = queries.computeIfAbsent(queryId, id -> Query.create(session, querySlug, queryManager, queryInfoUrlFactory.getQueryInfoUrl(queryId), directExchangeClientSupplier, responseExecutor, timeoutExecutor, blockEncodingSerde));
return query;
}
Aggregations