MCPcopy Index your code
hub / github.com/apache/orc / flushStripe

Method flushStripe

java/core/src/java/org/apache/orc/impl/WriterImpl.java:558–603  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

556 }
557
558 private void flushStripe() throws IOException {
559 if (buildIndex && rowsInIndex != 0) {
560 createRowIndexEntry();
561 }
562 if (rowsInStripe != 0) {
563 if (callback != null) {
564 callback.preStripeWrite(callbackContext);
565 }
566 // finalize the data for the stripe
567 int requiredIndexEntries = rowIndexStride == 0 ? 0 :
568 (int) ((rowsInStripe + rowIndexStride - 1) / rowIndexStride);
569 OrcProto.StripeFooter.Builder builder =
570 OrcProto.StripeFooter.newBuilder();
571 if (writeTimeZone) {
572 if (useUTCTimeZone) {
573 builder.setWriterTimezone("UTC");
574 } else {
575 builder.setWriterTimezone(TimeZone.getDefault().getID());
576 }
577 }
578 treeWriter.flushStreams();
579 treeWriter.writeStripe(requiredIndexEntries);
580 // update the encodings
581 builder.addAllColumns(unencryptedEncodings);
582 unencryptedEncodings.clear();
583 for (WriterEncryptionVariant writerEncryptionVariant : encryption) {
584 OrcProto.StripeEncryptionVariant.Builder encrypt =
585 OrcProto.StripeEncryptionVariant.newBuilder();
586 encrypt.addAllEncoding(writerEncryptionVariant.getEncodings());
587 writerEncryptionVariant.clearEncodings();
588 builder.addEncryption(encrypt);
589 }
590 OrcProto.StripeInformation.Builder dirEntry =
591 OrcProto.StripeInformation.newBuilder()
592 .setNumberOfRows(rowsInStripe);
593 if (encryption.length > 0 && needKeyFlush) {
594 addEncryptedKeys(dirEntry);
595 needKeyFlush = false;
596 }
597 physicalWriter.finalizeStripe(builder, dirEntry);
598
599 stripes.add(dirEntry.build());
600 rowCount += rowsInStripe;
601 rowsInStripe = 0;
602 }
603 }
604
605 private long computeRawDataSize() {
606 return treeWriter.getRawDataSize();

Callers 4

checkMemoryMethod · 0.95
closeMethod · 0.95
appendStripeMethod · 0.95

Calls 12

createRowIndexEntryMethod · 0.95
addEncryptedKeysMethod · 0.95
preStripeWriteMethod · 0.80
newBuilderMethod · 0.80
getEncodingsMethod · 0.80
clearEncodingsMethod · 0.80
flushStreamsMethod · 0.65
writeStripeMethod · 0.65
clearMethod · 0.65
finalizeStripeMethod · 0.65
addMethod · 0.65
buildMethod · 0.65

Tested by

no test coverage detected