()
| 688 | } |
| 689 | |
| 690 | private long writeFooter() throws IOException { |
| 691 | writeMetadata(); |
| 692 | OrcProto.Footer.Builder builder = OrcProto.Footer.newBuilder(); |
| 693 | builder.setNumberOfRows(rowCount); |
| 694 | builder.setRowIndexStride(rowIndexStride); |
| 695 | rawDataSize = computeRawDataSize(); |
| 696 | // serialize the types |
| 697 | writeTypes(builder, schema); |
| 698 | builder.setCalendar(useProlepticGregorian |
| 699 | ? OrcProto.CalendarKind.PROLEPTIC_GREGORIAN |
| 700 | : OrcProto.CalendarKind.JULIAN_GREGORIAN); |
| 701 | // add the stripe information |
| 702 | for(OrcProto.StripeInformation stripe: stripes) { |
| 703 | builder.addStripes(stripe); |
| 704 | } |
| 705 | // add the column statistics |
| 706 | treeWriter.writeFileStatistics(); |
| 707 | // add all of the user metadata |
| 708 | for(Map.Entry<String, ByteString> entry: userMetadata.entrySet()) { |
| 709 | builder.addMetadata(OrcProto.UserMetadataItem.newBuilder() |
| 710 | .setName(entry.getKey()).setValue(entry.getValue())); |
| 711 | } |
| 712 | if (encryption.length > 0) { |
| 713 | builder.setEncryption(writeEncryptionFooter()); |
| 714 | } |
| 715 | builder.setWriter(OrcFile.WriterImplementation.ORC_JAVA.getId()); |
| 716 | builder.setSoftwareVersion(OrcUtils.getOrcVersion()); |
| 717 | physicalWriter.writeFileFooter(builder); |
| 718 | return writePostScript(); |
| 719 | } |
| 720 | |
| 721 | @Override |
| 722 | public TypeDescription getSchema() { |
no test coverage detected