Class AvroReflectSerialization

All Implemented Interfaces:
Configurable, 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 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: 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.
      Specified by:
      getReader in class AvroSerialization<Object>
      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.
      Specified by:
      getSchema in class AvroSerialization<Object>
      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.
      Specified by:
      getWriter in class AvroSerialization<Object>
      Parameters:
      clazz - clazz.
      Returns:
      DatumWriter.