AvroSerialization (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.io.serializer.avro, class: AvroSerialization

Package org.apache.hadoop.io.serializer.avro

# 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
  Modifier and Type
  Field
  Description
  `static final String`
  `AVRO_SCHEMA_KEY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AvroSerialization()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `org.apache.hadoop.io.serializer.Deserializer<T>`
  `getDeserializer(Class<T> c)`
  `abstract org.apache.avro.io.DatumReader<T>`
  `getReader(Class<T> clazz)`
  Create and return Avro DatumReader for the given class.
  `abstract org.apache.avro.Schema`
  `getSchema(T t)`
  Return an Avro Schema instance for the given class.
  `org.apache.hadoop.io.serializer.Serializer<T>`
  `getSerializer(Class<T> c)`
  `abstract org.apache.avro.io.DatumWriter<T>`
  `getWriter(Class<T> clazz)`
  Create and return Avro DatumWriter for the given class.

  ### 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`

  ### Methods inherited from interface org.apache.hadoop.io.serializer.Serialization

  `accept`

- ## Field Details

  - ### AVRO_SCHEMA_KEY

    @Private public static final String AVRO_SCHEMA_KEY
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### AvroSerialization

    public AvroSerialization()

- ## Method Details

  - ### getDeserializer

    @Private public org.apache.hadoop.io.serializer.Deserializer<T> getDeserializer(Class<T> c)
    Specified by:
      `getDeserializer` in interface `org.apache.hadoop.io.serializer.Serialization<T>`
    Parameters:
      `c` - class.
    Returns:
      a `Deserializer` for the given class.

  - ### getSerializer

    @Private public org.apache.hadoop.io.serializer.Serializer<T> getSerializer(Class<T> c)
    Specified by:
      `getSerializer` in interface `org.apache.hadoop.io.serializer.Serialization<T>`
    Parameters:
      `c` - class.
    Returns:
      a `Serializer` for the given class.

  - ### getSchema

    @Private public abstract org.apache.avro.Schema getSchema(T t)
    Return an Avro Schema instance for the given class.
    Parameters:
      `t` - Generics Type T.
    Returns:
      schema.

  - ### getWriter

    @Private public abstract org.apache.avro.io.DatumWriter<T> getWriter(Class<T> clazz)
    Create and return Avro DatumWriter for the given class.
    Parameters:
      `clazz` - clazz.
    Returns:
      DatumWriter.

  - ### getReader

    @Private public abstract org.apache.avro.io.DatumReader<T> getReader(Class<T> clazz)
    Create and return Avro DatumReader for the given class.
    Parameters:
      `clazz` - clazz.
    Returns:
      DatumReader.