Package org.apache.flink.formats.avro
Class AvroDeserializationSchema<T>
java.lang.Object
org.apache.flink.formats.avro.AvroDeserializationSchema<T>
- Type Parameters:
T- type of record it produces
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.serialization.DeserializationSchema<T>,org.apache.flink.api.java.typeutils.ResultTypeQueryable<T>
- Direct Known Subclasses:
RegistryAvroDeserializationSchema
public class AvroDeserializationSchema<T>
extends Object
implements org.apache.flink.api.common.serialization.DeserializationSchema<T>
Deserialization schema that deserializes from Avro binary format.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.api.common.serialization.DeserializationSchema
org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(byte[] message) booleanstatic AvroDeserializationSchema<org.apache.avro.generic.GenericRecord>forGeneric(org.apache.avro.Schema schema) CreatesAvroDeserializationSchemathat producesGenericRecordusing provided schema.static AvroDeserializationSchema<org.apache.avro.generic.GenericRecord>forGeneric(org.apache.avro.Schema schema, AvroFormatOptions.AvroEncoding encoding) CreatesAvroDeserializationSchemathat producesGenericRecordusing provided schema.static <T extends org.apache.avro.specific.SpecificRecord>
AvroDeserializationSchema<T>forSpecific(Class<T> tClass) CreatesAvroDeserializationSchemathat produces classes that were generated from avro schema.static <T extends org.apache.avro.specific.SpecificRecord>
AvroDeserializationSchema<T>forSpecific(Class<T> tClass, AvroFormatOptions.AvroEncoding encoding) CreatesAvroDeserializationSchemathat produces classes that were generated from avro schema.org.apache.flink.api.common.typeinfo.TypeInformation<T>inthashCode()booleanisEndOfStream(T nextElement) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.api.common.serialization.DeserializationSchema
deserialize, open
-
Method Details
-
forGeneric
public static AvroDeserializationSchema<org.apache.avro.generic.GenericRecord> forGeneric(org.apache.avro.Schema schema) CreatesAvroDeserializationSchemathat producesGenericRecordusing provided schema.- Parameters:
schema- schema of produced records- Returns:
- deserialized record in form of
GenericRecord
-
forGeneric
public static AvroDeserializationSchema<org.apache.avro.generic.GenericRecord> forGeneric(org.apache.avro.Schema schema, AvroFormatOptions.AvroEncoding encoding) CreatesAvroDeserializationSchemathat producesGenericRecordusing provided schema.- Parameters:
schema- schema of produced recordsencoding- Avro serialization approach to use for decoding- Returns:
- deserialized record in form of
GenericRecord
-
forSpecific
public static <T extends org.apache.avro.specific.SpecificRecord> AvroDeserializationSchema<T> forSpecific(Class<T> tClass) CreatesAvroDeserializationSchemathat produces classes that were generated from avro schema.- Parameters:
tClass- class of record to be produced- Returns:
- deserialized record
-
forSpecific
public static <T extends org.apache.avro.specific.SpecificRecord> AvroDeserializationSchema<T> forSpecific(Class<T> tClass, AvroFormatOptions.AvroEncoding encoding) CreatesAvroDeserializationSchemathat produces classes that were generated from avro schema.- Parameters:
tClass- class of record to be producedencoding- Avro serialization approach to use for decoding- Returns:
- deserialized record
-
deserialize
- Specified by:
deserializein interfaceorg.apache.flink.api.common.serialization.DeserializationSchema<T>- Throws:
IOException
-
isEndOfStream
- Specified by:
isEndOfStreamin interfaceorg.apache.flink.api.common.serialization.DeserializationSchema<T>
-
getProducedType
- Specified by:
getProducedTypein interfaceorg.apache.flink.api.java.typeutils.ResultTypeQueryable<T>
-
equals
-
hashCode
public int hashCode()
-