Class SequenceFileRecordReader<K,V>
java.lang.Object
org.apache.hadoop.mapreduce.RecordReader<K,V>
org.apache.hadoop.mapreduce.lib.input.SequenceFileRecordReader<K,V>
- All Implemented Interfaces:
Closeable,AutoCloseable
An
RecordReader for SequenceFiles.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the record reader.Get the current keyGet the current value.floatReturn the progress within the input splitvoidinitialize(InputSplit split, TaskAttemptContext context) Called once at initialization.booleanRead the next key, value pair.
-
Field Details
-
conf
-
-
Constructor Details
-
SequenceFileRecordReader
public SequenceFileRecordReader()
-
-
Method Details
-
initialize
public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException Description copied from class:RecordReaderCalled once at initialization.- Specified by:
initializein classRecordReader<K,V> - Parameters:
split- the split that defines the range of records to readcontext- the information about the task- Throws:
IOExceptionInterruptedException
-
nextKeyValue
Description copied from class:RecordReaderRead the next key, value pair.- Specified by:
nextKeyValuein classRecordReader<K,V> - Returns:
- true if a key/value pair was read
- Throws:
IOExceptionInterruptedException
-
getCurrentKey
Description copied from class:RecordReaderGet the current key- Specified by:
getCurrentKeyin classRecordReader<K,V> - Returns:
- the current key or null if there is no current key
-
getCurrentValue
Description copied from class:RecordReaderGet the current value.- Specified by:
getCurrentValuein classRecordReader<K,V> - Returns:
- the object that was read
-
getProgress
Return the progress within the input split- Specified by:
getProgressin classRecordReader<K,V> - Returns:
- 0.0 to 1.0 of the input byte range
- Throws:
IOException
-
close
Description copied from class:RecordReaderClose the record reader.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classRecordReader<K,V> - Throws:
IOException
-