Package org.apache.flink.orc.writer
Class PhysicalWriterImpl
- java.lang.Object
-
- org.apache.flink.orc.writer.PhysicalWriterImpl
-
- All Implemented Interfaces:
org.apache.orc.PhysicalWriter
@Internal public class PhysicalWriterImpl extends Object implements org.apache.orc.PhysicalWriter
A slightly customised clone ofPhysicalFsWriter.Whereas PhysicalFsWriter implementation works on the basis of a Path, this implementation leverages Flink's
FSDataOutputStreamto write the compressed data.NOTE: If the ORC dependency version is updated, this file may have to be updated as well to be in sync with the new version's PhysicalFsWriter.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.orc.impl.OutStreamwriter
-
Constructor Summary
Constructors Constructor Description PhysicalWriterImpl(org.apache.flink.core.fs.FSDataOutputStream out, org.apache.orc.OrcFile.WriterOptions opts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendRawStripe(ByteBuffer buffer, org.apache.orc.OrcProto.StripeInformation.Builder dirEntry)voidclose()org.apache.orc.PhysicalWriter.OutputReceivercreateDataStream(org.apache.orc.impl.StreamName name)voidfinalizeStripe(org.apache.orc.OrcProto.StripeFooter.Builder footerBuilder, org.apache.orc.OrcProto.StripeInformation.Builder dirEntry)voidflush()org.apache.orc.CompressionCodecgetCompressionCodec()longgetFileBytes(int column)voidwriteBloomFilter(org.apache.orc.impl.StreamName name, org.apache.orc.OrcProto.BloomFilterIndex.Builder bloom, org.apache.orc.CompressionCodec codec)protected voidwriteFileFooter(org.apache.orc.OrcProto.Footer footer)voidwriteFileFooter(org.apache.orc.OrcProto.Footer.Builder builder)voidwriteFileMetadata(org.apache.orc.OrcProto.Metadata.Builder builder)voidwriteHeader()voidwriteIndex(org.apache.orc.impl.StreamName name, org.apache.orc.OrcProto.RowIndex.Builder index, org.apache.orc.CompressionCodec codec)protected voidwriteMetadata(org.apache.orc.OrcProto.Metadata metadata)longwritePostScript(org.apache.orc.OrcProto.PostScript.Builder builder)protected voidwriteStripeFooter(org.apache.orc.OrcProto.StripeFooter footer)
-
-
-
Constructor Detail
-
PhysicalWriterImpl
public PhysicalWriterImpl(org.apache.flink.core.fs.FSDataOutputStream out, org.apache.orc.OrcFile.WriterOptions opts) throws IOException- Throws:
IOException
-
-
Method Detail
-
writeHeader
public void writeHeader() throws IOException- Specified by:
writeHeaderin interfaceorg.apache.orc.PhysicalWriter- Throws:
IOException
-
createDataStream
public org.apache.orc.PhysicalWriter.OutputReceiver createDataStream(org.apache.orc.impl.StreamName name) throws IOException- Specified by:
createDataStreamin interfaceorg.apache.orc.PhysicalWriter- Throws:
IOException
-
writeIndex
public void writeIndex(org.apache.orc.impl.StreamName name, org.apache.orc.OrcProto.RowIndex.Builder index, org.apache.orc.CompressionCodec codec) throws IOException- Specified by:
writeIndexin interfaceorg.apache.orc.PhysicalWriter- Throws:
IOException
-
writeBloomFilter
public void writeBloomFilter(org.apache.orc.impl.StreamName name, org.apache.orc.OrcProto.BloomFilterIndex.Builder bloom, org.apache.orc.CompressionCodec codec) throws IOException- Specified by:
writeBloomFilterin interfaceorg.apache.orc.PhysicalWriter- Throws:
IOException
-
finalizeStripe
public void finalizeStripe(org.apache.orc.OrcProto.StripeFooter.Builder footerBuilder, org.apache.orc.OrcProto.StripeInformation.Builder dirEntry) throws IOException- Specified by:
finalizeStripein interfaceorg.apache.orc.PhysicalWriter- Throws:
IOException
-
writeFileMetadata
public void writeFileMetadata(org.apache.orc.OrcProto.Metadata.Builder builder) throws IOException- Specified by:
writeFileMetadatain interfaceorg.apache.orc.PhysicalWriter- Throws:
IOException
-
writeFileFooter
public void writeFileFooter(org.apache.orc.OrcProto.Footer.Builder builder) throws IOException- Specified by:
writeFileFooterin interfaceorg.apache.orc.PhysicalWriter- Throws:
IOException
-
writePostScript
public long writePostScript(org.apache.orc.OrcProto.PostScript.Builder builder) throws IOException- Specified by:
writePostScriptin interfaceorg.apache.orc.PhysicalWriter- Throws:
IOException
-
close
public void close()
- Specified by:
closein interfaceorg.apache.orc.PhysicalWriter
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceorg.apache.orc.PhysicalWriter- Throws:
IOException
-
appendRawStripe
public void appendRawStripe(ByteBuffer buffer, org.apache.orc.OrcProto.StripeInformation.Builder dirEntry) throws IOException
- Specified by:
appendRawStripein interfaceorg.apache.orc.PhysicalWriter- Throws:
IOException
-
getCompressionCodec
public org.apache.orc.CompressionCodec getCompressionCodec()
- Specified by:
getCompressionCodecin interfaceorg.apache.orc.PhysicalWriter
-
getFileBytes
public long getFileBytes(int column)
- Specified by:
getFileBytesin interfaceorg.apache.orc.PhysicalWriter
-
writeMetadata
protected void writeMetadata(org.apache.orc.OrcProto.Metadata metadata) throws IOException- Throws:
IOException
-
writeFileFooter
protected void writeFileFooter(org.apache.orc.OrcProto.Footer footer) throws IOException- Throws:
IOException
-
writeStripeFooter
protected void writeStripeFooter(org.apache.orc.OrcProto.StripeFooter footer) throws IOException- Throws:
IOException
-
-