Class CompressWriterFactory<IN>
- java.lang.Object
-
- org.apache.flink.formats.compress.CompressWriterFactory<IN>
-
- Type Parameters:
IN- The type of element to write.
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.serialization.BulkWriter.Factory<IN>
@PublicEvolving public class CompressWriterFactory<IN> extends Object implements org.apache.flink.api.common.serialization.BulkWriter.Factory<IN>
A factory that creates forbulk writersthat, when provided with aCompressionCodec, they compress the data they write. If no codec is provided, the data is written in bulk but uncompressed.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CompressWriterFactory(Extractor<IN> extractor)Creates a new CompressWriterFactory using the givenExtractorto assemble eitherHadoopCompressionBulkWriterorNoCompressionBulkWriterbased on whether a Hadoop CompressionCodec name is specified.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.api.common.serialization.BulkWriter<IN>create(org.apache.flink.core.fs.FSDataOutputStream out)StringgetExtension()CompressWriterFactory<IN>withHadoopCompression(String codecName)Compresses the data using the provided HadoopCompressionCodec.CompressWriterFactory<IN>withHadoopCompression(String codecName, org.apache.hadoop.conf.Configuration hadoopConfig)Compresses the data using the provided HadoopCompressionCodecandConfiguration.
-
-
-
Constructor Detail
-
CompressWriterFactory
public CompressWriterFactory(Extractor<IN> extractor)
Creates a new CompressWriterFactory using the givenExtractorto assemble eitherHadoopCompressionBulkWriterorNoCompressionBulkWriterbased on whether a Hadoop CompressionCodec name is specified.- Parameters:
extractor- Extractor to extract the element
-
-
Method Detail
-
withHadoopCompression
public CompressWriterFactory<IN> withHadoopCompression(String codecName) throws IOException
Compresses the data using the provided HadoopCompressionCodec.- Parameters:
codecName- Simple/complete name or alias of the CompressionCodec- Returns:
- the instance of CompressionWriterFactory
- Throws:
IOException
-
withHadoopCompression
public CompressWriterFactory<IN> withHadoopCompression(String codecName, org.apache.hadoop.conf.Configuration hadoopConfig) throws IOException
Compresses the data using the provided HadoopCompressionCodecandConfiguration.- Parameters:
codecName- Simple/complete name or alias of the CompressionCodechadoopConfig- Hadoop Configuration- Returns:
- the instance of CompressionWriterFactory
- Throws:
IOException
-
create
public org.apache.flink.api.common.serialization.BulkWriter<IN> create(org.apache.flink.core.fs.FSDataOutputStream out) throws IOException
- Specified by:
createin interfaceorg.apache.flink.api.common.serialization.BulkWriter.Factory<IN>- Throws:
IOException
-
getExtension
public String getExtension()
-
-