Class AvroReflectSerialization

All Implemented Interfaces:
Configurable, org.apache.hadoop.io.serializer.Serialization<Object>

@Public @Evolving public class AvroReflectSerialization extends AvroSerialization<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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    AVRO_REFLECT_PACKAGES
    Key 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accept(Class<?> c)
    Allows clients to test whether this Serialization supports the given class.
    org.apache.avro.io.DatumReader
    getReader(Class<Object> clazz)
    Create and return Avro DatumReader for the given class.
    org.apache.avro.Schema
    getSchema(Object t)
    Return an Avro Schema instance for the given class.
    org.apache.avro.io.DatumWriter
    getWriter(Class<Object> clazz)
    Create and return Avro DatumWriter for the given class.

    Methods inherited from class org.apache.hadoop.io.serializer.avro.AvroSerialization

    getDeserializer, getSerializer

    Methods inherited from class org.apache.hadoop.conf.Configured

    getConf, setConf

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • AVRO_REFLECT_PACKAGES

      @Private public static final String 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

      @Private public boolean accept(Class<?> c)
      Description copied from interface: org.apache.hadoop.io.serializer.Serialization
      Allows clients to test whether this Serialization supports the given class.
      Parameters:
      c - class.
      Returns:
      if accept true,not false.
    • getReader

      @Private public org.apache.avro.io.DatumReader getReader(Class<Object> clazz)
      Description copied from class: AvroSerialization
      Create and return Avro DatumReader for the given class.
      Parameters:
      clazz - clazz.
      Returns:
      DatumReader.
    • getSchema

      @Private public org.apache.avro.Schema getSchema(Object t)
      Description copied from class: AvroSerialization
      Return an Avro Schema instance for the given class.
      Parameters:
      t - Generics Type T.
      Returns:
      schema.
    • getWriter

      @Private public org.apache.avro.io.DatumWriter getWriter(Class<Object> clazz)
      Description copied from class: AvroSerialization
      Create and return Avro DatumWriter for the given class.
      Parameters:
      clazz - clazz.
      Returns:
      DatumWriter.