Package org.apache.avro.mapreduce
Class AvroKeyValueRecordReader<K,V>
java.lang.Object
org.apache.hadoop.mapreduce.RecordReader<AvroKey<K>,AvroValue<V>>
org.apache.avro.mapreduce.AvroRecordReaderBase<AvroKey<K>,AvroValue<V>,GenericRecord>
org.apache.avro.mapreduce.AvroKeyValueRecordReader<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 AvroKeyValueRecordReader<K,V>
extends AvroRecordReaderBase<AvroKey<K>,AvroValue<V>,GenericRecord>
Reads Avro generic records from an Avro 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
ConstructorsConstructorDescriptionAvroKeyValueRecordReader(Schema keyReaderSchema, Schema valueReaderSchema) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanMethods inherited from class org.apache.avro.mapreduce.AvroRecordReaderBase
close, createAvroFileReader, createSeekableInput, getCurrentRecord, getProgress, initialize
-
Constructor Details
-
AvroKeyValueRecordReader
Constructor.- Parameters:
keyReaderSchema- The reader schema for the key within the generic record.valueReaderSchema- The reader schema for the value within the generic record.
-
-
Method Details
-
nextKeyValue
- Overrides:
nextKeyValuein classAvroRecordReaderBase<AvroKey<K>,AvroValue<V>, GenericRecord> - Throws:
IOExceptionInterruptedException
-
getCurrentKey
- Specified by:
getCurrentKeyin classRecordReader<AvroKey<K>,AvroValue<V>> - Throws:
IOExceptionInterruptedException
-
getCurrentValue
- Specified by:
getCurrentValuein classRecordReader<AvroKey<K>,AvroValue<V>> - Throws:
IOExceptionInterruptedException
-