Class AvroReflectSerialization
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.io.serializer.avro.AvroSerialization<Object>
org.apache.hadoop.io.serializer.avro.AvroReflectSerialization
- All Implemented Interfaces:
Configurable,org.apache.hadoop.io.serializer.Serialization<Object>
Serialization for Avro Reflect classes. For a class to be accepted by this
serialization, it must either be in the package list configured via
avro.reflect.pkgs or implement
AvroReflectSerializable interface.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAVRO_REFLECT_PACKAGESKey to configure packages that contain classes to be serialized and deserialized using this class.Fields inherited from class org.apache.hadoop.io.serializer.avro.AvroSerialization
AVRO_SCHEMA_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(Class<?> c) Allows clients to test whether thisSerializationsupports the given class.org.apache.avro.io.DatumReaderCreate and return Avro DatumReader for the given class.org.apache.avro.SchemagetSchema(Object t) Return an Avro Schema instance for the given class.org.apache.avro.io.DatumWriterCreate and return Avro DatumWriter for the given class.Methods inherited from class org.apache.hadoop.io.serializer.avro.AvroSerialization
getDeserializer, getSerializerMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
-
Field Details
-
AVRO_REFLECT_PACKAGES
Key to configure packages that contain classes to be serialized and deserialized using this class. Multiple packages can be specified using comma-separated list.- See Also:
-
-
Constructor Details
-
AvroReflectSerialization
public AvroReflectSerialization()
-
-
Method Details
-
accept
Description copied from interface:org.apache.hadoop.io.serializer.SerializationAllows clients to test whether thisSerializationsupports the given class.- Parameters:
c- class.- Returns:
- if accept true,not false.
-
getReader
Description copied from class:AvroSerializationCreate and return Avro DatumReader for the given class.- Parameters:
clazz- clazz.- Returns:
- DatumReader.
-
getSchema
Description copied from class:AvroSerializationReturn an Avro Schema instance for the given class.- Parameters:
t- Generics Type T.- Returns:
- schema.
-
getWriter
Description copied from class:AvroSerializationCreate and return Avro DatumWriter for the given class.- Parameters:
clazz- clazz.- Returns:
- DatumWriter.
-