org.apache.trevni.avro.mapreduce

## Class AvroTrevniKeyRecordWriter<T>

- java.lang.Object
- - org.apache.hadoop.mapreduce.RecordWriter<K,V>
  - - org.apache.trevni.avro.mapreduce.AvroTrevniRecordWriterBase<org.apache.avro.mapred.AvroKey<T>,NullWritable,T>
    - - org.apache.trevni.avro.mapreduce.AvroTrevniKeyRecordWriter<T>

Type Parameters:
  `T` - The Java type of the Trevni data to write.

    public class AvroTrevniKeyRecordWriter<T>
    extends AvroTrevniRecordWriterBase<org.apache.avro.mapred.AvroKey<T>,NullWritable,T>

Writes Trevni records to an Trevni container file output stream.

### Field Summary

### Fields inherited from class org.apache.trevni.avro.mapreduce.AvroTrevniRecordWriterBase

`EXT, meta, META_PREFIX, part, schema, writer`

### Constructor Summary

Constructors
Constructor and Description
`AvroTrevniKeyRecordWriter(TaskAttemptContext context)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected org.apache.avro.Schema` `initSchema(TaskAttemptContext context)` Use the task context to construct a schema for writing
`void` `write(org.apache.avro.mapred.AvroKey<T> key, NullWritable value)`

### Methods inherited from class org.apache.trevni.avro.mapreduce.AvroTrevniRecordWriterBase

`close, flush`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### AvroTrevniKeyRecordWriter

    public AvroTrevniKeyRecordWriter(TaskAttemptContext context)
                              throws IOException

Constructor.

Parameters:
  `context` - The TaskAttempContext to supply the writer with information form the job configuration
Throws:
  `IOException`

### Method Detail

#### write

    public void write(org.apache.avro.mapred.AvroKey<T> key,
                      NullWritable value)
               throws IOException,
                      InterruptedException

Specified by:
  `write` in class `RecordWriter<org.apache.avro.mapred.AvroKey<T>,NullWritable>`
Throws:
  `IOException`
  `InterruptedException`

#### initSchema

    protected org.apache.avro.Schema initSchema(TaskAttemptContext context)

Use the task context to construct a schema for writing

Specified by:
  `initSchema` in class `AvroTrevniRecordWriterBase<org.apache.avro.mapred.AvroKey<T>,NullWritable,T>`