Package org.apache.flink.orc.writer
Class PhysicalWriterImpl
java.lang.Object
org.apache.flink.orc.writer.PhysicalWriterImpl
- All Implemented Interfaces:
org.apache.orc.PhysicalWriter
A slightly customised clone of
PhysicalFsWriter.
Whereas PhysicalFsWriter implementation works on the basis of a Path, this implementation
leverages Flink's FSDataOutputStream to 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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.orc.PhysicalWriter
org.apache.orc.PhysicalWriter.OutputReceiver -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPhysicalWriterImpl(org.apache.flink.core.fs.FSDataOutputStream out, org.apache.orc.OrcFile.WriterOptions opts) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendRawStripe(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.CompressionCodeclonggetFileBytes(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) voidvoidwriteIndex(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)
-
Field Details
-
writer
protected final org.apache.orc.impl.OutStream writer
-
-
Constructor Details
-
PhysicalWriterImpl
public PhysicalWriterImpl(org.apache.flink.core.fs.FSDataOutputStream out, org.apache.orc.OrcFile.WriterOptions opts) throws IOException - Throws:
IOException
-
-
Method Details
-
writeHeader
- 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
-
writeFileMetadata
- Specified by:
writeFileMetadatain interfaceorg.apache.orc.PhysicalWriter- Throws:
IOException
-
writePostScript
- Specified by:
writePostScriptin interfaceorg.apache.orc.PhysicalWriter- Throws:
IOException
-
close
public void close()- Specified by:
closein interfaceorg.apache.orc.PhysicalWriter
-
flush
- 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
- Throws:
IOException
-