/** * Number of bytes already flushed to the data sink. */ public long getWrittenBytes() { return orcDataSink.size(); }
/** * Number of bytes already flushed to the data sink. */ public long getWrittenBytes() { return orcDataSink.size(); }
private void flushStripe(FlushReason flushReason) throws IOException { List<OrcDataOutput> outputData = new ArrayList<>(); long stripeStartOffset = orcDataSink.size(); // add header to first stripe (this is not required but nice to have) if (closedStripes.isEmpty()) { outputData.add(createDataOutput(MAGIC)); stripeStartOffset += MAGIC.length(); } // add stripe data outputData.addAll(bufferStripeData(stripeStartOffset, flushReason)); // if the file is being closed, add the file footer if (flushReason == CLOSED) { outputData.addAll(bufferFileFooter()); } // write all data orcDataSink.write(outputData); // open next stripe columnWriters.forEach(ColumnWriter::reset); dictionaryCompressionOptimizer.reset(); rowGroupRowCount = 0; stripeRowCount = 0; bufferedBytes = toIntExact(columnWriters.stream().mapToLong(ColumnWriter::getBufferedBytes).sum()); }
private void flushStripe(FlushReason flushReason) throws IOException { List<OrcDataOutput> outputData = new ArrayList<>(); long stripeStartOffset = orcDataSink.size(); // add header to first stripe (this is not required but nice to have) if (closedStripes.isEmpty()) { outputData.add(createDataOutput(MAGIC)); stripeStartOffset += MAGIC.length(); } // add stripe data outputData.addAll(bufferStripeData(stripeStartOffset, flushReason)); // if the file is being closed, add the file footer if (flushReason == CLOSED) { outputData.addAll(bufferFileFooter()); } // write all data orcDataSink.write(outputData); // open next stripe columnWriters.forEach(ColumnWriter::reset); dictionaryCompressionOptimizer.reset(); rowGroupRowCount = 0; stripeRowCount = 0; bufferedBytes = toIntExact(columnWriters.stream().mapToLong(ColumnWriter::getBufferedBytes).sum()); }