Package org.apache.hadoop.mapred
Class SequenceFileRecordReader<K,V>
java.lang.Object
org.apache.hadoop.mapred.SequenceFileRecordReader<K,V>
- All Implemented Interfaces:
Closeable,AutoCloseable,RecordReader<K,V>
@Public
@Stable
public class SequenceFileRecordReader<K,V>
extends Object
implements RecordReader<K,V>
An
RecordReader for SequenceFiles.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close thisInputSplitto future operations.Create an object of the appropriate type to be used as a key.Create an object of the appropriate type to be used as a value.protected voidgetCurrentValue(V value) The class of key that must be passed tonext(Object, Object)..longgetPos()Returns the current position in the input.floatReturn the progress within the input splitThe class of value that must be passed tonext(Object, Object)..protected booleanbooleanReads the next key/value pair from the input for processing.protected voidseek(long pos)
-
Field Details
-
conf
-
-
Constructor Details
-
SequenceFileRecordReader
- Throws:
IOException
-
-
Method Details
-
getKeyClass
The class of key that must be passed tonext(Object, Object).. -
getValueClass
The class of value that must be passed tonext(Object, Object).. -
createKey
Description copied from interface:RecordReaderCreate an object of the appropriate type to be used as a key.- Specified by:
createKeyin interfaceRecordReader<K,V> - Returns:
- a new key object.
-
createValue
Description copied from interface:RecordReaderCreate an object of the appropriate type to be used as a value.- Specified by:
createValuein interfaceRecordReader<K,V> - Returns:
- a new value object.
-
next
Description copied from interface:RecordReaderReads the next key/value pair from the input for processing.- Specified by:
nextin interfaceRecordReader<K,V> - Parameters:
key- the key to read data intovalue- the value to read data into- Returns:
- true iff a key/value was read, false if at EOF
- Throws:
IOException
-
next
- Throws:
IOException
-
getCurrentValue
- Throws:
IOException
-
getProgress
Return the progress within the input split- Specified by:
getProgressin interfaceRecordReader<K,V> - Returns:
- 0.0 to 1.0 of the input byte range
- Throws:
IOException
-
getPos
Description copied from interface:RecordReaderReturns the current position in the input.- Specified by:
getPosin interfaceRecordReader<K,V> - Returns:
- the current position in the input.
- Throws:
IOException
-
seek
- Throws:
IOException
-
close
Description copied from interface:RecordReaderClose thisInputSplitto future operations.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceRecordReader<K,V> - Throws:
IOException
-