public class PhysicalFsWriter extends Object implements PhysicalWriter
PhysicalWriter.OutputReceiver| Constructor and Description |
|---|
PhysicalFsWriter(FileSystem fs,
Path path,
OrcFile.WriterOptions opts) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendRawStripe(ByteBuffer buffer,
OrcProto.StripeInformation.Builder dirEntry)
Appends raw stripe data (e.g.
|
void |
close()
Closes the writer.
|
org.apache.orc.impl.PhysicalFsWriter.BufferedStream |
createDataStream(StreamName name)
Create an OutputReceiver for the given name.
|
void |
finalizeStripe(OrcProto.StripeFooter.Builder footerBuilder,
OrcProto.StripeInformation.Builder dirEntry)
Flushes the data in all the streams, spills them to disk, write out stripe
footer.
|
void |
flush()
Flushes the writer so that readers can see the preceeding postscripts.
|
CompressionCodec |
getCompressionCodec()
Gets a compression codec used by this writer.
|
long |
getFileBytes(int column)
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.
|
String |
toString() |
void |
writeBloomFilter(StreamName name,
OrcProto.BloomFilterIndex.Builder bloom,
CompressionCodec codec)
Write a bloom filter index in the given stream name.
|
void |
writeFileFooter(OrcProto.Footer.Builder builder)
Writes out the file footer.
|
void |
writeFileMetadata(OrcProto.Metadata.Builder builder)
Writes out the file metadata.
|
void |
writeHeader()
Writes the header of the file, which consists of the magic "ORC" bytes.
|
void |
writeIndex(StreamName name,
OrcProto.RowIndex.Builder index,
CompressionCodec codec)
Write an index in the given stream name.
|
long |
writePostScript(OrcProto.PostScript.Builder builder)
Writes out the postscript (including the size byte if needed).
|
public PhysicalFsWriter(FileSystem fs, Path path, OrcFile.WriterOptions opts) throws IOException
IOExceptionpublic CompressionCodec getCompressionCodec()
PhysicalWritergetCompressionCodec in interface PhysicalWriterpublic long getFileBytes(int column)
getFileBytes in interface PhysicalWritercolumn - column from which to get file sizepublic void writeFileMetadata(OrcProto.Metadata.Builder builder) throws IOException
PhysicalWriterwriteFileMetadata in interface PhysicalWriterbuilder - Metadata builder to finalize and write.IOExceptionpublic void writeFileFooter(OrcProto.Footer.Builder builder) throws IOException
PhysicalWriterwriteFileFooter in interface PhysicalWriterbuilder - Footer builder to finalize and write.IOExceptionpublic long writePostScript(OrcProto.PostScript.Builder builder) throws IOException
PhysicalWriterwritePostScript in interface PhysicalWriterbuilder - Postscript builder to finalize and write.IOExceptionpublic void close()
throws IOException
PhysicalWriterclose in interface PhysicalWriterIOExceptionpublic void flush()
throws IOException
PhysicalWriterflush in interface PhysicalWriterIOExceptionpublic void appendRawStripe(ByteBuffer buffer, OrcProto.StripeInformation.Builder dirEntry) throws IOException
PhysicalWriterappendRawStripe in interface PhysicalWriterbuffer - Stripe data buffer.dirEntry - File metadata entry for the stripe, to be updated with
relevant data.IOExceptionpublic void finalizeStripe(OrcProto.StripeFooter.Builder footerBuilder, OrcProto.StripeInformation.Builder dirEntry) throws IOException
PhysicalWriterfinalizeStripe in interface PhysicalWriterfooterBuilder - Stripe footer to be updated with relevant data and written out.dirEntry - File metadata entry for the stripe, to be updated with
relevant data.IOExceptionpublic void writeHeader()
throws IOException
PhysicalWriterwriteHeader in interface PhysicalWriterIOExceptionpublic org.apache.orc.impl.PhysicalFsWriter.BufferedStream createDataStream(StreamName name)
PhysicalWritercreateDataStream in interface PhysicalWritername - the name of the streampublic void writeIndex(StreamName name, OrcProto.RowIndex.Builder index, CompressionCodec codec) throws IOException
PhysicalWriterwriteIndex in interface PhysicalWritername - the name of the streamindex - the bloom filter to writecodec - the compression codec to useIOExceptionpublic void writeBloomFilter(StreamName name, OrcProto.BloomFilterIndex.Builder bloom, CompressionCodec codec) throws IOException
PhysicalWriterwriteBloomFilter in interface PhysicalWritername - the name of the streambloom - the bloom filter to writecodec - the compression codec to useIOExceptionCopyright © 2013–2018 The Apache Software Foundation. All rights reserved.