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 -
Method Summary
Methods inherited from class org.apache.trevni.avro.mapreduce.AvroTrevniRecordReaderBase
close, getCurrentRecord, getProgress, initialize
-
Constructor Details
-
AvroTrevniKeyValueRecordReader
public AvroTrevniKeyValueRecordReader()
-
-
Method Details
-
getCurrentKey
- Specified by:
getCurrentKey
in classRecordReader<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 classRecordReader<org.apache.avro.mapred.AvroKey<K>,
org.apache.avro.mapred.AvroValue<V>> - Throws:
IOException
InterruptedException
-
nextKeyValue
- Overrides:
nextKeyValue
in classAvroTrevniRecordReaderBase<org.apache.avro.mapred.AvroKey<K>,
org.apache.avro.mapred.AvroValue<V>, org.apache.avro.generic.GenericRecord> - Throws:
IOException
InterruptedException
-