use of io.prestosql.orc.OrcRowDataCacheKey in project hetu-core by openlookeng.
the class CachingColumnReader method getCachedBlock.
private Block getCachedBlock(long rowCount, InputStreamSources dataStreamSources) throws IOException {
OrcRowDataCacheKey cacheKey = new OrcRowDataCacheKey();
cacheKey.setOrcDataSourceId(new OrcDataSourceIdWithTimeStamp(orcDataSourceId, lastModifiedTime));
cacheKey.setStripeOffset(stripeOffset);
cacheKey.setRowGroupOffset(rowGroupOffset);
cacheKey.setColumnId(columnId);
try {
return cache.get(cacheKey, () -> {
delegate.startRowGroup(dataStreamSources);
delegate.prepareNextRead((int) rowCount);
log.debug("Caching row group data. DatasourceId = %s, columnId = %s, stripeOffset = %d, rowGroupOffset = %d, Column = %s", orcDataSourceId, columnId, stripeOffset, rowGroupOffset, column);
return delegate.readBlock();
});
} catch (UncheckedExecutionException | ExecutionException executionException) {
handleCacheLoadException(executionException);
log.debug(executionException.getCause(), "Error while caching row group data. Falling back to default flow...");
delegate.startRowGroup(dataStreamSources);
delegate.prepareNextRead((int) rowCount);
cachedBlock = delegate.readBlock();
return cachedBlock;
}
}
use of io.prestosql.orc.OrcRowDataCacheKey in project hetu-core by openlookeng.
the class DataCachingSelectiveColumnReader method getCachedBlock.
private Block getCachedBlock(long rowCount, InputStreamSources dataStreamSources) throws IOException {
OrcRowDataCacheKey cacheKey = new OrcRowDataCacheKey();
cacheKey.setOrcDataSourceId(new OrcDataSourceIdWithTimeStamp(orcDataSourceId, lastModifiedTime));
cacheKey.setStripeOffset(stripeOffset);
cacheKey.setRowGroupOffset(rowGroupOffset);
cacheKey.setColumnId(columnId);
try {
return cache.get(cacheKey, () -> {
delegate.startRowGroup(dataStreamSources);
delegate.prepareNextRead((int) rowCount);
log.debug("Caching row group data. DatasourceId = %s, columnId = %s, stripeOffset = %d, rowGroupOffset = %d, Column = %s", orcDataSourceId, columnId, stripeOffset, rowGroupOffset, column);
return delegate.readBlock();
});
} catch (UncheckedExecutionException | ExecutionException executionException) {
handleCacheLoadException(executionException);
log.debug(executionException.getCause(), "Error while caching row group data. Falling back to default flow...");
delegate.startRowGroup(dataStreamSources);
delegate.prepareNextRead((int) rowCount);
cachedBlock = delegate.readBlock();
return cachedBlock;
}
}
Aggregations