Class AvroDatumConverterFactory

java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.avro.hadoop.io.AvroDatumConverterFactory
All Implemented Interfaces:
Configurable

public class AvroDatumConverterFactory extends Configured
Constructs converters that turn objects (usually from the output of a MR job) into Avro data that can be serialized.

Currently, only the following types have implemented converters:

  • AvroKey
  • AvroValue
  • BooleanWritable
  • BytesWritable
  • ByteWritable
  • DoubleWritable
  • FloatWritable
  • IntWritable
  • LongWritable
  • NullWritable
  • Text

  • Constructor Details

    • AvroDatumConverterFactory

      public AvroDatumConverterFactory(Configuration conf)
      Creates a new AvroDatumConverterFactory instance.
      Parameters:
      conf - The job configuration.
  • Method Details

    • create

      public <IN, OUT> AvroDatumConverter<IN,OUT> create(Class<IN> inputClass)
      Creates a converter that turns objects of type inputClass into Avro data.
      Parameters:
      inputClass - The type of input data to convert.
      Returns:
      A converter that turns objects of type inputClass into Avro data.