public class PhysicalFsWriter extends Object implements org.apache.orc.PhysicalWriter
NOTE: The file was copied and modified to support zstd-jni. This feature is only supported in ORC 2.0, but 2.0 only supports JDK17. We need to support JDK8.
| Modifier and Type | Class and Description | 
|---|---|
protected static class  | 
PhysicalFsWriter.VariantTracker
Record the information about each column encryption variant. 
 | 
| Constructor and Description | 
|---|
PhysicalFsWriter(org.apache.hadoop.fs.FileSystem fs,
                org.apache.hadoop.fs.Path path,
                OrcFile.WriterOptions opts)  | 
PhysicalFsWriter(org.apache.hadoop.fs.FileSystem fs,
                org.apache.hadoop.fs.Path path,
                OrcFile.WriterOptions opts,
                org.apache.orc.impl.writer.WriterEncryptionVariant[] encryption)  | 
PhysicalFsWriter(org.apache.hadoop.fs.FSDataOutputStream outputStream,
                OrcFile.WriterOptions opts,
                org.apache.orc.impl.writer.WriterEncryptionVariant[] encryption)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
appendRawStripe(ByteBuffer buffer,
               org.apache.orc.OrcProto.StripeInformation.Builder dirEntry)  | 
void | 
close()  | 
org.apache.orc.impl.PhysicalFsWriter.BufferedStream | 
createDataStream(org.apache.orc.impl.StreamName name)  | 
protected OutputStream | 
createIndexStream(org.apache.orc.impl.StreamName name)  | 
void | 
finalizeStripe(org.apache.orc.OrcProto.StripeFooter.Builder footerBuilder,
              org.apache.orc.OrcProto.StripeInformation.Builder dirEntry)  | 
void | 
flush()  | 
long | 
getFileBytes(int column,
            org.apache.orc.impl.writer.WriterEncryptionVariant variant)
Get the number of bytes for a file in a given column by finding all the streams (not
 suppressed) for a given column and returning the sum of their sizes. 
 | 
org.apache.orc.impl.writer.StreamOptions | 
getStreamOptions()  | 
String | 
toString()  | 
void | 
writeBloomFilter(org.apache.orc.impl.StreamName name,
                org.apache.orc.OrcProto.BloomFilterIndex.Builder bloom)  | 
void | 
writeFileFooter(org.apache.orc.OrcProto.Footer.Builder builder)  | 
void | 
writeFileMetadata(org.apache.orc.OrcProto.Metadata.Builder builder)  | 
void | 
writeHeader()  | 
void | 
writeIndex(org.apache.orc.impl.StreamName name,
          org.apache.orc.OrcProto.RowIndex.Builder index)  | 
long | 
writePostScript(org.apache.orc.OrcProto.PostScript.Builder builder)  | 
void | 
writeStatistics(org.apache.orc.impl.StreamName name,
               org.apache.orc.OrcProto.ColumnStatistics.Builder statistics)  | 
public PhysicalFsWriter(org.apache.hadoop.fs.FileSystem fs,
                        org.apache.hadoop.fs.Path path,
                        OrcFile.WriterOptions opts)
                 throws IOException
IOExceptionpublic PhysicalFsWriter(org.apache.hadoop.fs.FileSystem fs,
                        org.apache.hadoop.fs.Path path,
                        OrcFile.WriterOptions opts,
                        org.apache.orc.impl.writer.WriterEncryptionVariant[] encryption)
                 throws IOException
IOExceptionpublic PhysicalFsWriter(org.apache.hadoop.fs.FSDataOutputStream outputStream,
                        OrcFile.WriterOptions opts,
                        org.apache.orc.impl.writer.WriterEncryptionVariant[] encryption)
                 throws IOException
IOExceptionpublic long getFileBytes(int column,
                         org.apache.orc.impl.writer.WriterEncryptionVariant variant)
column - column from which to get file sizepublic org.apache.orc.impl.writer.StreamOptions getStreamOptions()
public void writeFileMetadata(org.apache.orc.OrcProto.Metadata.Builder builder)
                       throws IOException
writeFileMetadata in interface org.apache.orc.PhysicalWriterIOExceptionpublic void writeFileFooter(org.apache.orc.OrcProto.Footer.Builder builder)
                     throws IOException
writeFileFooter in interface org.apache.orc.PhysicalWriterIOExceptionpublic long writePostScript(org.apache.orc.OrcProto.PostScript.Builder builder)
                     throws IOException
writePostScript in interface org.apache.orc.PhysicalWriterIOExceptionpublic void close()
           throws IOException
close in interface org.apache.orc.PhysicalWriterIOExceptionpublic void flush()
           throws IOException
flush in interface org.apache.orc.PhysicalWriterIOExceptionpublic void appendRawStripe(ByteBuffer buffer, org.apache.orc.OrcProto.StripeInformation.Builder dirEntry) throws IOException
appendRawStripe in interface org.apache.orc.PhysicalWriterIOExceptionpublic void finalizeStripe(org.apache.orc.OrcProto.StripeFooter.Builder footerBuilder,
                           org.apache.orc.OrcProto.StripeInformation.Builder dirEntry)
                    throws IOException
finalizeStripe in interface org.apache.orc.PhysicalWriterIOExceptionpublic void writeHeader()
                 throws IOException
writeHeader in interface org.apache.orc.PhysicalWriterIOExceptionpublic org.apache.orc.impl.PhysicalFsWriter.BufferedStream createDataStream(org.apache.orc.impl.StreamName name)
createDataStream in interface org.apache.orc.PhysicalWriterprotected OutputStream createIndexStream(org.apache.orc.impl.StreamName name)
public void writeIndex(org.apache.orc.impl.StreamName name,
                       org.apache.orc.OrcProto.RowIndex.Builder index)
                throws IOException
IOExceptionpublic void writeBloomFilter(org.apache.orc.impl.StreamName name,
                             org.apache.orc.OrcProto.BloomFilterIndex.Builder bloom)
                      throws IOException
IOExceptionpublic void writeStatistics(org.apache.orc.impl.StreamName name,
                            org.apache.orc.OrcProto.ColumnStatistics.Builder statistics)
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.