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
RecordReader
s that read Trevni container
files.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected T
Gets the current record read from the Trevni container file.float
void
initialize
(InputSplit inputSplit, TaskAttemptContext context) boolean
Methods 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:
initialize
in classRecordReader<K,
V> - Throws:
IOException
InterruptedException
-
nextKeyValue
- Specified by:
nextKeyValue
in classRecordReader<K,
V> - Throws:
IOException
InterruptedException
-
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classRecordReader<K,
V> - Throws:
IOException
-
getProgress
- Specified by:
getProgress
in classRecordReader<K,
V> - Throws:
IOException
InterruptedException
-