use of com.facebook.presto.orc.stream.SharedBuffer in project presto by prestodb.
the class StripeReader method readStripeFooter.
public StripeFooter readStripeFooter(StripeId stripeId, StripeInformation stripe, OrcAggregatedMemoryContext systemMemoryUsage) throws IOException {
long footerOffset = stripe.getOffset() + stripe.getIndexLength() + stripe.getDataLength();
int footerLength = toIntExact(stripe.getFooterLength());
// read the footer
Slice footerSlice = stripeMetadataSource.getStripeFooterSlice(orcDataSource, stripeId, footerOffset, footerLength, cacheable);
try (InputStream inputStream = new OrcInputStream(orcDataSource.getId(), // Memory is not accounted as the buffer is expected to be tiny and will be immediately discarded
new SharedBuffer(NOOP_ORC_LOCAL_MEMORY_CONTEXT), footerSlice.getInput(), decompressor, Optional.empty(), systemMemoryUsage, footerLength)) {
return metadataReader.readStripeFooter(orcDataSource.getId(), types, inputStream);
}
}
Aggregations