Class AvroSerialization<T>
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.io.serializer.avro.AvroSerialization<T>
- All Implemented Interfaces:
Configurable,org.apache.hadoop.io.serializer.Serialization<T>
- Direct Known Subclasses:
AvroReflectSerialization,AvroSpecificSerialization
@Public
@Evolving
public abstract class AvroSerialization<T>
extends Configured
implements org.apache.hadoop.io.serializer.Serialization<T>
Base class for providing serialization to Avro types.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.io.serializer.Deserializer<T>abstract org.apache.avro.io.DatumReader<T>Create and return Avro DatumReader for the given class.abstract org.apache.avro.SchemagetSchema(T t) Return an Avro Schema instance for the given class.org.apache.hadoop.io.serializer.Serializer<T>abstract org.apache.avro.io.DatumWriter<T>Create and return Avro DatumWriter for the given class.Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.io.serializer.Serialization
accept
-
Field Details
-
AVRO_SCHEMA_KEY
- See Also:
-
-
Constructor Details
-
AvroSerialization
public AvroSerialization()
-
-
Method Details
-
getDeserializer
- Specified by:
getDeserializerin interfaceorg.apache.hadoop.io.serializer.Serialization<T>- Parameters:
c- class.- Returns:
- a
Deserializerfor the given class.
-
getSerializer
- Specified by:
getSerializerin interfaceorg.apache.hadoop.io.serializer.Serialization<T>- Parameters:
c- class.- Returns:
- a
Serializerfor the given class.
-
getSchema
Return an Avro Schema instance for the given class.- Parameters:
t- Generics Type T.- Returns:
- schema.
-
getWriter
Create and return Avro DatumWriter for the given class.- Parameters:
clazz- clazz.- Returns:
- DatumWriter.
-
getReader
Create and return Avro DatumReader for the given class.- Parameters:
clazz- clazz.- Returns:
- DatumReader.
-