Package org.apache.orc.impl
Class PhysicalFsWriter
java.lang.Object
org.apache.orc.impl.PhysicalFsWriter
- All Implemented Interfaces:
PhysicalWriter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classRecord the information about each column encryption variant.Nested classes/interfaces inherited from interface org.apache.orc.PhysicalWriter
PhysicalWriter.OutputReceiver -
Constructor Summary
ConstructorsConstructorDescriptionPhysicalFsWriter(FileSystem fs, Path path, OrcFile.WriterOptions opts) PhysicalFsWriter(FileSystem fs, Path path, OrcFile.WriterOptions opts, WriterEncryptionVariant[] encryption) PhysicalFsWriter(FSDataOutputStream outputStream, OrcFile.WriterOptions opts, WriterEncryptionVariant[] encryption) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendRawStripe(ByteBuffer buffer, OrcProto.StripeInformation.Builder dirEntry) Appends raw stripe data (e.g.voidclose()Closes the writer.createDataStream(StreamName name) Create an OutputReceiver for the given name.protected OutputStreamcreateIndexStream(StreamName name) voidfinalizeStripe(OrcProto.StripeFooter.Builder footerBuilder, OrcProto.StripeInformation.Builder dirEntry) Flushes the data in all the streams, spills them to disk, write out stripe footer.voidflush()Flushes the writer so that readers can see the preceding postscripts.longgetFileBytes(int column, 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.Get the unencrypted stream options for this file.toString()voidwriteBloomFilter(StreamName name, OrcProto.BloomFilterIndex.Builder bloom) Write a bloom filter index in the given stream name.voidwriteFileFooter(OrcProto.Footer.Builder builder) Writes out the file footer.voidWrites out the file metadata.voidWrites the header of the file, which consists of the magic "ORC" bytes.voidwriteIndex(StreamName name, OrcProto.RowIndex.Builder index) Write an index in the given stream name.longWrites out the postscript (including the size byte if needed).voidwriteStatistics(StreamName name, OrcProto.ColumnStatistics.Builder statistics) Write a stripe or file statistics to the file.
-
Constructor Details
-
PhysicalFsWriter
- Throws:
IOException
-
PhysicalFsWriter
public PhysicalFsWriter(FileSystem fs, Path path, OrcFile.WriterOptions opts, WriterEncryptionVariant[] encryption) throws IOException - Throws:
IOException
-
PhysicalFsWriter
public PhysicalFsWriter(FSDataOutputStream outputStream, OrcFile.WriterOptions opts, WriterEncryptionVariant[] encryption) throws IOException - Throws:
IOException
-
-
Method Details
-
getFileBytes
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. excludes index- Specified by:
getFileBytesin interfacePhysicalWriter- Parameters:
column- column from which to get file sizevariant- the encryption variant to check- Returns:
- number of bytes for the given column
-
getStreamOptions
Description copied from interface:PhysicalWriterGet the unencrypted stream options for this file. This class needs the stream options to write the indexes and footers. Additionally, the LLAP CacheWriter wants to disable the generic compression.- Specified by:
getStreamOptionsin interfacePhysicalWriter
-
writeFileMetadata
Description copied from interface:PhysicalWriterWrites out the file metadata.- Specified by:
writeFileMetadatain interfacePhysicalWriter- Parameters:
builder- Metadata builder to finalize and write.- Throws:
IOException
-
writePostScript
Description copied from interface:PhysicalWriterWrites out the postscript (including the size byte if needed).- Specified by:
writePostScriptin interfacePhysicalWriter- Parameters:
builder- Postscript builder to finalize and write.- Throws:
IOException
-
close
Description copied from interface:PhysicalWriterCloses the writer.- Specified by:
closein interfacePhysicalWriter- Throws:
IOException
-
flush
Description copied from interface:PhysicalWriterFlushes the writer so that readers can see the preceding postscripts.- Specified by:
flushin interfacePhysicalWriter- Throws:
IOException
-
appendRawStripe
public void appendRawStripe(ByteBuffer buffer, OrcProto.StripeInformation.Builder dirEntry) throws IOException Description copied from interface:PhysicalWriterAppends raw stripe data (e.g. for file merger).- Specified by:
appendRawStripein interfacePhysicalWriter- Parameters:
buffer- Stripe data buffer.dirEntry- File metadata entry for the stripe, to be updated with relevant data.- Throws:
IOException
-
writeHeader
Description copied from interface:PhysicalWriterWrites the header of the file, which consists of the magic "ORC" bytes.- Specified by:
writeHeaderin interfacePhysicalWriter- Throws:
IOException
-
createDataStream
Description copied from interface:PhysicalWriterCreate an OutputReceiver for the given name.- Specified by:
createDataStreamin interfacePhysicalWriter- Parameters:
name- the name of the stream
-
createIndexStream
-
writeIndex
Description copied from interface:PhysicalWriterWrite an index in the given stream name.- Specified by:
writeIndexin interfacePhysicalWriter- Parameters:
name- the name of the streamindex- the bloom filter to write- Throws:
IOException
-
writeBloomFilter
public void writeBloomFilter(StreamName name, OrcProto.BloomFilterIndex.Builder bloom) throws IOException Description copied from interface:PhysicalWriterWrite a bloom filter index in the given stream name.- Specified by:
writeBloomFilterin interfacePhysicalWriter- Parameters:
name- the name of the streambloom- the bloom filter to write- Throws:
IOException
-
writeStatistics
Description copied from interface:PhysicalWriterWrite a stripe or file statistics to the file.- Specified by:
writeStatisticsin interfacePhysicalWriter- Parameters:
name- the name of the streamstatistics- the statistics to write
-
toString
-