Package org.apache.trevni.avro.mapreduce

# Class AvroTrevniKeyValueRecordReader<K,V>

java.lang.Object
org.apache.hadoop.mapreduce.RecordReader<org.apache.avro.mapred.AvroKey<K>,org.apache.avro.mapred.AvroValue<V>>
org.apache.trevni.avro.mapreduce.AvroTrevniRecordReaderBase<org.apache.avro.mapred.AvroKey<K>,org.apache.avro.mapred.AvroValue<V>,org.apache.avro.generic.GenericRecord>
org.apache.trevni.avro.mapreduce.AvroTrevniKeyValueRecordReader<K,V>

Type Parameters:
  `K` - The type of the Avro key to read.
  `V` - The type of the Avro value to read.

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

public class AvroTrevniKeyValueRecordReader<K,V> extends AvroTrevniRecordReaderBase<org.apache.avro.mapred.AvroKey<K>,org.apache.avro.mapred.AvroValue<V>,org.apache.avro.generic.GenericRecord>
Reads Trevni generic records from an Trevni container file, where the records contain two fields: 'key' and 'value'.

The contents of the 'key' field will be parsed into an AvroKey object. The contents of the 'value' field will be parsed into an AvroValue object.

## Constructor Summary

Constructors
Constructor
Description
`AvroTrevniKeyValueRecordReader()`

## Method Summary

Modifier and Type
Method
Description
`org.apache.avro.mapred.AvroKey<K>`
`getCurrentKey()`
`org.apache.avro.mapred.AvroValue<V>`
`getCurrentValue()`
`boolean`
`nextKeyValue()`

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

`close, getCurrentRecord, getProgress, initialize`

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

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

## Constructor Details

### AvroTrevniKeyValueRecordReader

public AvroTrevniKeyValueRecordReader()

## Method Details

### getCurrentKey

public org.apache.avro.mapred.AvroKey<K> getCurrentKey() throws IOException, InterruptedException

Specified by:
  `getCurrentKey` in class `RecordReader<org.apache.avro.mapred.AvroKey<K>,org.apache.avro.mapred.AvroValue<V>>`
Throws:
  `IOException`
  `InterruptedException`

### getCurrentValue

public org.apache.avro.mapred.AvroValue<V> getCurrentValue() throws IOException, InterruptedException

Specified by:
  `getCurrentValue` in class `RecordReader<org.apache.avro.mapred.AvroKey<K>,org.apache.avro.mapred.AvroValue<V>>`
Throws:
  `IOException`
  `InterruptedException`

### nextKeyValue

public boolean nextKeyValue() throws IOException, InterruptedException

Overrides:
  `nextKeyValue` in class `AvroTrevniRecordReaderBase<org.apache.avro.mapred.AvroKey<K>,org.apache.avro.mapred.AvroValue<V>,org.apache.avro.generic.GenericRecord>`
Throws:
  `IOException`
  `InterruptedException`