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
Abstract base class for
RecordReaders that read Trevni container
files.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected TGets the current record read from the Trevni container file.floatvoidinitialize(InputSplit inputSplit, TaskAttemptContext context) booleanMethods inherited from class org.apache.hadoop.mapreduce.RecordReader
getCurrentKey, getCurrentValue
-
Constructor Details
-
AvroTrevniRecordReaderBase
public AvroTrevniRecordReaderBase()
-
-
Method Details
-
initialize
public void initialize(InputSplit inputSplit, TaskAttemptContext context) throws IOException, InterruptedException - Specified by:
initializein classRecordReader<K,V> - Throws:
IOExceptionInterruptedException
-
nextKeyValue
- Specified by:
nextKeyValuein classRecordReader<K,V> - Throws:
IOExceptionInterruptedException
-
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
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classRecordReader<K,V> - Throws:
IOException
-
getProgress
- Specified by:
getProgressin classRecordReader<K,V> - Throws:
IOExceptionInterruptedException
-