Package org.apache.avro.mapreduce

# Class AvroKeyRecordReader<T>

java.lang.Object
org.apache.hadoop.mapreduce.RecordReader<AvroKey<T>,NullWritable>
org.apache.avro.mapreduce.AvroRecordReaderBase<AvroKey<T>,NullWritable,T>
org.apache.avro.mapreduce.AvroKeyRecordReader<T>

Type Parameters:
  `T` - The (java) type of data in Avro container file.

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

public class AvroKeyRecordReader<T> extends AvroRecordReaderBase<AvroKey<T>,NullWritable,T>
Reads records from an input split representing a chunk of an Avro container file.

## Constructor Summary

Constructors
Constructor
Description
`AvroKeyRecordReader(org.apache.avro.Schema readerSchema)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`AvroKey<T>`
`getCurrentKey()`
`NullWritable`
`getCurrentValue()`
`boolean`
`nextKeyValue()`

### Methods inherited from class org.apache.avro.mapreduce.AvroRecordReaderBase

`close, createAvroFileReader, createSeekableInput, getCurrentRecord, getProgress, initialize`

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

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

## Constructor Details

### AvroKeyRecordReader

public AvroKeyRecordReader(org.apache.avro.Schema readerSchema)
Constructor.

Parameters:
  `readerSchema` - The reader schema to use for the records in the Avro container file.

## Method Details

### nextKeyValue

public boolean nextKeyValue() throws IOException, InterruptedException

Overrides:
  `nextKeyValue` in class `AvroRecordReaderBase<AvroKey<T>,NullWritable,T>`
Throws:
  `IOException`
  `InterruptedException`

### getCurrentKey

public AvroKey<T> getCurrentKey() throws IOException, InterruptedException

Specified by:
  `getCurrentKey` in class `RecordReader<AvroKey<T>,NullWritable>`
Throws:
  `IOException`
  `InterruptedException`

### getCurrentValue

public NullWritable getCurrentValue() throws IOException, InterruptedException

Specified by:
  `getCurrentValue` in class `RecordReader<AvroKey<T>,NullWritable>`
Throws:
  `IOException`
  `InterruptedException`