org.apache.trevni.avro.mapreduce

## Class AvroTrevniKeyRecordWriter<T>

- java.lang.Object
- - org.apache.hadoop.mapreduce.RecordWriter<K,V>
  - - org.apache.trevni.avro.mapreduce.AvroTrevniRecordWriterBase<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<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
    Modifier and Type | Method and Description
    --- | ---
    `protected Schema` | `initSchema(TaskAttemptContext context)` Use the task context to construct a schema for writing
    `void` | `write(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(AvroKey<T> key,
                            NullWritable value)
                     throws IOException,
                            InterruptedException

      Specified by:
        `write` in class `RecordWriter<AvroKey<T>,NullWritable>`
      Throws:
        `IOException`
        `InterruptedException`

    - #### initSchema

          protected Schema initSchema(TaskAttemptContext context)

      Use the task context to construct a schema for writing
      Specified by:
        `initSchema` in class `AvroTrevniRecordWriterBase<AvroKey<T>,NullWritable,T>`

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.