Class AvroKeyRecordWriter<T>

java.lang.Object
org.apache.hadoop.mapreduce.RecordWriter<AvroKey<T>,NullWritable>
org.apache.avro.mapreduce.AvroKeyRecordWriter<T>
Type Parameters:
T - The Java type of the Avro data to write.
All Implemented Interfaces:
Syncable

public class AvroKeyRecordWriter<T> extends RecordWriter<AvroKey<T>,NullWritable> implements Syncable
Writes Avro records to an Avro container file output stream.
  • Constructor Details

    • AvroKeyRecordWriter

      public AvroKeyRecordWriter(Schema writerSchema, GenericData dataModel, CodecFactory compressionCodec, OutputStream outputStream, int syncInterval) throws IOException
      Constructor.
      Parameters:
      writerSchema - The writer schema for the records in the Avro container file.
      compressionCodec - A compression codec factory for the Avro container file.
      outputStream - The output stream to write the Avro container file to.
      syncInterval - The sync interval for the Avro container file.
      Throws:
      IOException - If the record writer cannot be opened.
    • AvroKeyRecordWriter

      public AvroKeyRecordWriter(Schema writerSchema, GenericData dataModel, CodecFactory compressionCodec, OutputStream outputStream) throws IOException
      Constructor.
      Parameters:
      writerSchema - The writer schema for the records in the Avro container file.
      compressionCodec - A compression codec factory for the Avro container file.
      outputStream - The output stream to write the Avro container file to.
      Throws:
      IOException - If the record writer cannot be opened.
  • Method Details