Package org.apache.flink.formats.avro
Class AvroOutputFormat<E>
java.lang.Object
org.apache.flink.api.common.io.RichOutputFormat<IT>
org.apache.flink.api.common.io.FileOutputFormat<E>
org.apache.flink.formats.avro.AvroOutputFormat<E>
- Type Parameters:
E-
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.io.CleanupWhenUnsuccessful,org.apache.flink.api.common.io.InitializeOnMaster,org.apache.flink.api.common.io.OutputFormat<E>
public class AvroOutputFormat<E>
extends org.apache.flink.api.common.io.FileOutputFormat<E>
implements Serializable
FileOutputFormat for Avro records.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWrapper which encapsulates the supported codec and a related serialization byte.Nested classes/interfaces inherited from class org.apache.flink.api.common.io.FileOutputFormat
org.apache.flink.api.common.io.FileOutputFormat.OutputDirectoryModeNested classes/interfaces inherited from interface org.apache.flink.api.common.io.OutputFormat
org.apache.flink.api.common.io.OutputFormat.InitializationContext -
Field Summary
Fields inherited from class org.apache.flink.api.common.io.FileOutputFormat
outputFilePath, stream -
Constructor Summary
ConstructorsConstructorDescriptionAvroOutputFormat(Class<E> type) AvroOutputFormat(org.apache.flink.core.fs.Path filePath, Class<E> type) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected StringgetDirectoryFileName(int taskNumber) voidopen(org.apache.flink.api.common.io.OutputFormat.InitializationContext context) voidsetCodec(AvroOutputFormat.Codec codec) Set avro codec for compression.voidsetSchema(org.apache.avro.Schema schema) voidwriteRecord(E record) Methods inherited from class org.apache.flink.api.common.io.FileOutputFormat
configure, getOutputDirectoryMode, getOutputFilePath, getWriteMode, initDefaultsFromConfiguration, initializeGlobal, setOutputDirectoryMode, setOutputFilePath, setWriteMode, tryCleanupOnErrorMethods inherited from class org.apache.flink.api.common.io.RichOutputFormat
getRuntimeContext, setRuntimeContext
-
Constructor Details
-
AvroOutputFormat
-
AvroOutputFormat
-
-
Method Details
-
getDirectoryFileName
- Overrides:
getDirectoryFileNamein classorg.apache.flink.api.common.io.FileOutputFormat<E>
-
setSchema
public void setSchema(org.apache.avro.Schema schema) -
setCodec
Set avro codec for compression.- Parameters:
codec- avro codec.
-
writeRecord
- Specified by:
writeRecordin interfaceorg.apache.flink.api.common.io.OutputFormat<E>- Throws:
IOException
-
open
public void open(org.apache.flink.api.common.io.OutputFormat.InitializationContext context) throws IOException - Specified by:
openin interfaceorg.apache.flink.api.common.io.OutputFormat<E>- Overrides:
openin classorg.apache.flink.api.common.io.FileOutputFormat<E>- Throws:
IOException
-
close
- Specified by:
closein interfaceorg.apache.flink.api.common.io.OutputFormat<E>- Overrides:
closein classorg.apache.flink.api.common.io.FileOutputFormat<E>- Throws:
IOException
-