Package org.apache.flink.formats.avro
Class AvroWriters
- java.lang.Object
-
- org.apache.flink.formats.avro.AvroWriters
-
public class AvroWriters extends Object
Convenience builder to createAvroWriterFactoryinstances for the different Avro types.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AvroWriterFactory<org.apache.avro.generic.GenericRecord>forGenericRecord(org.apache.avro.Schema schema)Creates anAvroWriterFactorythat accepts and writes Avro generic types.static <T> AvroWriterFactory<T>forReflectRecord(Class<T> type)Creates anAvroWriterFactoryfor the given type.static <T extends org.apache.avro.specific.SpecificRecordBase>
AvroWriterFactory<T>forSpecificRecord(Class<T> type)Creates anAvroWriterFactoryfor an Avro specific type.
-
-
-
Method Detail
-
forSpecificRecord
public static <T extends org.apache.avro.specific.SpecificRecordBase> AvroWriterFactory<T> forSpecificRecord(Class<T> type)
Creates anAvroWriterFactoryfor an Avro specific type. The Avro writers will use the schema of that specific type to build and write the records.- Parameters:
type- The class of the type to write.
-
forGenericRecord
public static AvroWriterFactory<org.apache.avro.generic.GenericRecord> forGenericRecord(org.apache.avro.Schema schema)
Creates anAvroWriterFactorythat accepts and writes Avro generic types. The Avro writers will use the given schema to build and write the records.- Parameters:
schema- The schema of the generic type.
-
forReflectRecord
public static <T> AvroWriterFactory<T> forReflectRecord(Class<T> type)
Creates anAvroWriterFactoryfor the given type. The Avro writers will use reflection to create the schema for the type and use that schema to write the records.- Parameters:
type- The class of the type to write.
-
-