Class AvroUtils
- java.lang.Object
-
- org.apache.flink.api.java.typeutils.AvroUtils
-
public abstract class AvroUtils extends Object
Utility methods for dealing with Avro types. This has a default implementation for the case that Avro is not present on the classpath and an actual implementation in flink-avro that is dynamically loaded when present.
-
-
Constructor Summary
Constructors Constructor Description AvroUtils()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaddAvroGenericDataArrayRegistration(LinkedHashMap<String,KryoRegistration> kryoRegistrations)Registers a special Serializer for GenericData.Array.abstract voidaddAvroSerializersIfRequired(ExecutionConfig reg, Class<?> type)Loads the utility class fromflink-avroand adds Avro-specific serializers.abstract <T> TypeSerializer<T>createAvroSerializer(Class<T> type)Creates anAvroSerializerif flink-avro is present, otherwise throws an exception.abstract <T> TypeInformation<T>createAvroTypeInfo(Class<T> type)Creates anAvroTypeInfoif flink-avro is present, otherwise throws an exception.static AvroUtilsgetAvroUtils()Returns either the defaultAvroUtilswhich throw an exception in cases where Avro would be needed or loads the specific utils for Avro from flink-avro.
-
-
-
Method Detail
-
getAvroUtils
public static AvroUtils getAvroUtils()
Returns either the defaultAvroUtilswhich throw an exception in cases where Avro would be needed or loads the specific utils for Avro from flink-avro.
-
addAvroSerializersIfRequired
public abstract void addAvroSerializersIfRequired(ExecutionConfig reg, Class<?> type)
Loads the utility class fromflink-avroand adds Avro-specific serializers. This method will throw an exception if we see an Avro type but flink-avro is not in the classpath.
-
addAvroGenericDataArrayRegistration
public abstract void addAvroGenericDataArrayRegistration(LinkedHashMap<String,KryoRegistration> kryoRegistrations)
Registers a special Serializer for GenericData.Array.
-
createAvroSerializer
public abstract <T> TypeSerializer<T> createAvroSerializer(Class<T> type)
Creates anAvroSerializerif flink-avro is present, otherwise throws an exception.
-
createAvroTypeInfo
public abstract <T> TypeInformation<T> createAvroTypeInfo(Class<T> type)
Creates anAvroTypeInfoif flink-avro is present, otherwise throws an exception.
-
-