Class SequenceFileAsTextRecordReader
java.lang.Object
org.apache.hadoop.mapreduce.RecordReader<Text,Text>
org.apache.hadoop.mapreduce.lib.input.SequenceFileAsTextRecordReader
- All Implemented Interfaces:
Closeable,AutoCloseable
This class converts the input keys and values to their String forms by
calling toString() method. This class to SequenceFileAsTextInputFormat
class is as LineRecordReader class to TextInputFormat class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the record reader.Get the current keyGet the current value.floatThe current progress of the record reader through its data.voidinitialize(InputSplit split, TaskAttemptContext context) Called once at initialization.booleanRead key/value pair in a line.
-
Constructor Details
-
SequenceFileAsTextRecordReader
- Throws:
IOException
-
-
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<Text,Text> - Parameters:
split- the split that defines the range of records to readcontext- the information about the task- Throws:
IOExceptionInterruptedException
-
getCurrentKey
Description copied from class:RecordReaderGet the current key- Specified by:
getCurrentKeyin classRecordReader<Text,Text> - Returns:
- the current key or null if there is no current key
- Throws:
IOExceptionInterruptedException
-
getCurrentValue
Description copied from class:RecordReaderGet the current value.- Specified by:
getCurrentValuein classRecordReader<Text,Text> - Returns:
- the object that was read
- Throws:
IOExceptionInterruptedException
-
nextKeyValue
Read key/value pair in a line.- Specified by:
nextKeyValuein classRecordReader<Text,Text> - Returns:
- true if a key/value pair was read
- Throws:
IOExceptionInterruptedException
-
getProgress
Description copied from class:RecordReaderThe current progress of the record reader through its data.- Specified by:
getProgressin classRecordReader<Text,Text> - Returns:
- a number between 0.0 and 1.0 that is the fraction of the data read
- Throws:
IOExceptionInterruptedException
-
close
Description copied from class:RecordReaderClose the record reader.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classRecordReader<Text,Text> - Throws:
IOException
-