Class AvroKryoSerializerUtils
- java.lang.Object
-
- org.apache.flink.api.java.typeutils.AvroUtils
-
- org.apache.flink.formats.avro.utils.AvroKryoSerializerUtils
-
public class AvroKryoSerializerUtils extends AvroUtils
Utilities for integrating Avro serializers in Kryo.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AvroKryoSerializerUtils.AvroSchemaSerializer
Slow serialization approach for Avro schemas.
-
Field Summary
-
Fields inherited from class org.apache.flink.api.java.typeutils.AvroUtils
AVRO_SPECIFIC_RECORD_BASE_CLASS
-
-
Constructor Summary
Constructors Constructor Description AvroKryoSerializerUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAvroGenericDataArrayRegistration(LinkedHashMap<String,KryoRegistration> kryoRegistrations)
Registers a special Serializer for GenericData.Array.void
addAvroSerializersIfRequired(SerializerConfig reg, Class<?> type)
Loads the utility class fromflink-avro
and adds Avro-specific serializers.<T> TypeSerializer<T>
createAvroSerializer(Class<T> type)
Creates anAvroSerializer
if flink-avro is present, otherwise throws an exception.<T> TypeInformation<T>
createAvroTypeInfo(Class<T> type)
Creates anAvroTypeInfo
if flink-avro is present, otherwise throws an exception.-
Methods inherited from class org.apache.flink.api.java.typeutils.AvroUtils
getAvroUtils, isAvroSpecificRecord, tryGetAvroUtils
-
-
-
-
Method Detail
-
addAvroSerializersIfRequired
public void addAvroSerializersIfRequired(SerializerConfig reg, Class<?> type)
Description copied from class:AvroUtils
Loads the utility class fromflink-avro
and adds Avro-specific serializers. This method will throw an exception if we see an Avro type but flink-avro is not in the classpath.- Specified by:
addAvroSerializersIfRequired
in classAvroUtils
-
addAvroGenericDataArrayRegistration
public void addAvroGenericDataArrayRegistration(LinkedHashMap<String,KryoRegistration> kryoRegistrations)
Description copied from class:AvroUtils
Registers a special Serializer for GenericData.Array.- Specified by:
addAvroGenericDataArrayRegistration
in classAvroUtils
-
createAvroSerializer
public <T> TypeSerializer<T> createAvroSerializer(Class<T> type)
Description copied from class:AvroUtils
Creates anAvroSerializer
if flink-avro is present, otherwise throws an exception.- Specified by:
createAvroSerializer
in classAvroUtils
-
createAvroTypeInfo
public <T> TypeInformation<T> createAvroTypeInfo(Class<T> type)
Description copied from class:AvroUtils
Creates anAvroTypeInfo
if flink-avro is present, otherwise throws an exception.- Specified by:
createAvroTypeInfo
in classAvroUtils
-
-