Package org.apache.flink.orc.writer
Class PhysicalWriterImpl
- java.lang.Object
-
- org.apache.flink.orc.writer.PhysicalWriterImpl
-
- All Implemented Interfaces:
org.apache.orc.PhysicalWriter
- Direct Known Subclasses:
NoHivePhysicalWriterImpl
@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
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.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.orc.impl.OutStream
writer
-
Constructor Summary
Constructors Constructor Description PhysicalWriterImpl(FSDataOutputStream out, org.apache.orc.OrcFile.WriterOptions opts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendRawStripe(ByteBuffer buffer, org.apache.orc.OrcProto.StripeInformation.Builder dirEntry)
void
close()
org.apache.orc.PhysicalWriter.OutputReceiver
createDataStream(org.apache.orc.impl.StreamName name)
void
finalizeStripe(org.apache.orc.OrcProto.StripeFooter.Builder footerBuilder, org.apache.orc.OrcProto.StripeInformation.Builder dirEntry)
void
flush()
org.apache.orc.CompressionCodec
getCompressionCodec()
long
getFileBytes(int column)
void
writeBloomFilter(org.apache.orc.impl.StreamName name, org.apache.orc.OrcProto.BloomFilterIndex.Builder bloom, org.apache.orc.CompressionCodec codec)
protected void
writeFileFooter(org.apache.orc.OrcProto.Footer footer)
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, org.apache.orc.CompressionCodec codec)
protected void
writeMetadata(org.apache.orc.OrcProto.Metadata metadata)
long
writePostScript(org.apache.orc.OrcProto.PostScript.Builder builder)
protected void
writeStripeFooter(org.apache.orc.OrcProto.StripeFooter footer)
-
-
-
Constructor Detail
-
PhysicalWriterImpl
public PhysicalWriterImpl(FSDataOutputStream out, org.apache.orc.OrcFile.WriterOptions opts) throws IOException
- Throws:
IOException
-
-
Method Detail
-
writeHeader
public void writeHeader() throws IOException
- Specified by:
writeHeader
in interfaceorg.apache.orc.PhysicalWriter
- Throws:
IOException
-
createDataStream
public org.apache.orc.PhysicalWriter.OutputReceiver createDataStream(org.apache.orc.impl.StreamName name) throws IOException
- Specified by:
createDataStream
in 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:
writeIndex
in 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:
writeBloomFilter
in 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:
finalizeStripe
in interfaceorg.apache.orc.PhysicalWriter
- Throws:
IOException
-
writeFileMetadata
public void writeFileMetadata(org.apache.orc.OrcProto.Metadata.Builder builder) throws IOException
- Specified by:
writeFileMetadata
in interfaceorg.apache.orc.PhysicalWriter
- Throws:
IOException
-
writeFileFooter
public void writeFileFooter(org.apache.orc.OrcProto.Footer.Builder builder) throws IOException
- Specified by:
writeFileFooter
in interfaceorg.apache.orc.PhysicalWriter
- Throws:
IOException
-
writePostScript
public long writePostScript(org.apache.orc.OrcProto.PostScript.Builder builder) throws IOException
- Specified by:
writePostScript
in interfaceorg.apache.orc.PhysicalWriter
- Throws:
IOException
-
close
public void close()
- Specified by:
close
in interfaceorg.apache.orc.PhysicalWriter
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceorg.apache.orc.PhysicalWriter
- Throws:
IOException
-
appendRawStripe
public void appendRawStripe(ByteBuffer buffer, org.apache.orc.OrcProto.StripeInformation.Builder dirEntry) throws IOException
- Specified by:
appendRawStripe
in interfaceorg.apache.orc.PhysicalWriter
- Throws:
IOException
-
getCompressionCodec
public org.apache.orc.CompressionCodec getCompressionCodec()
- Specified by:
getCompressionCodec
in interfaceorg.apache.orc.PhysicalWriter
-
getFileBytes
public long getFileBytes(int column)
- Specified by:
getFileBytes
in 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
-
-