Package org.apache.trevni.avro.mapreduce

# Class AvroTrevniRecordReaderBase<K,V,T>

java.lang.Object
org.apache.hadoop.mapreduce.RecordReader<K,V>
org.apache.trevni.avro.mapreduce.AvroTrevniRecordReaderBase<K,V,T>

Type Parameters:
  `K` - The type of key the record reader should generate.
  `V` - The type of value the record reader should generate.
  `T` - The type of the entries within the Trevni container file being read.

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

Direct Known Subclasses:
  `AvroTrevniKeyRecordReader`, `AvroTrevniKeyValueRecordReader`

public abstract class AvroTrevniRecordReaderBase<K,V,T> extends RecordReader<K,V>
Abstract base class for `RecordReader`s that read Trevni container files.

## Constructor Summary

Constructors
Constructor
Description
`AvroTrevniRecordReaderBase()`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`protected T`
`getCurrentRecord()`
Gets the current record read from the Trevni container file.
`float`
`getProgress()`
`void`
`initialize(InputSplit inputSplit, TaskAttemptContext context)`
`boolean`
`nextKeyValue()`

### Methods inherited from class org.apache.hadoop.mapreduce.RecordReader

`getCurrentKey, getCurrentValue`

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

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

## Constructor Details

### AvroTrevniRecordReaderBase

public AvroTrevniRecordReaderBase()

## Method Details

### initialize

public void initialize(InputSplit inputSplit, TaskAttemptContext context) throws IOException, InterruptedException

Specified by:
  `initialize` in class `RecordReader<K,V>`
Throws:
  `IOException`
  `InterruptedException`

### nextKeyValue

public boolean nextKeyValue() throws IOException, InterruptedException

Specified by:
  `nextKeyValue` in class `RecordReader<K,V>`
Throws:
  `IOException`
  `InterruptedException`

### getCurrentRecord

protected T getCurrentRecord()
Gets the current record read from the Trevni container file.

Calling `nextKeyValue()` moves this to the next record.

Returns:
  The current Trevni record (may be null if no record has been read).

### close

public void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in class `RecordReader<K,V>`
Throws:
  `IOException`

### getProgress

public float getProgress() throws IOException, InterruptedException

Specified by:
  `getProgress` in class `RecordReader<K,V>`
Throws:
  `IOException`
  `InterruptedException`