Package org.apache.hadoop.mapred.lib
Class CombineFileRecordReaderWrapper<K,V>
java.lang.Object
org.apache.hadoop.mapred.lib.CombineFileRecordReaderWrapper<K,V>
- All Implemented Interfaces:
Closeable,AutoCloseable,RecordReader<K,V>
@Public
@Stable
public abstract class CombineFileRecordReaderWrapper<K,V>
extends Object
implements RecordReader<K,V>
A wrapper class for a record reader that handles a single file split. It
delegates most of the methods to the wrapped instance. A concrete subclass
needs to provide a constructor that calls this parent constructor with the
appropriate input format. The subclass constructor must satisfy the specific
constructor signature that is required by
CombineFileRecordReader.
Subclassing is needed to get a concrete record reader wrapper because of the
constructor requirement.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCombineFileRecordReaderWrapper(FileInputFormat<K, V> inputFormat, CombineFileSplit split, Configuration conf, Reporter reporter, Integer idx) -
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.longgetPos()Returns the current position in the input.floatHow much of the input has theRecordReaderconsumed i.e.booleanReads the next key/value pair from the input for processing.
-
Constructor Details
-
CombineFileRecordReaderWrapper
protected CombineFileRecordReaderWrapper(FileInputFormat<K, V> inputFormat, CombineFileSplit split, Configuration conf, Reporter reporter, Integer idx) throws IOException- Throws:
IOException
-
-
Method Details
-
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
-
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.
-
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
-
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
-
getProgress
Description copied from interface:RecordReaderHow much of the input has theRecordReaderconsumed i.e. has been processed by?- Specified by:
getProgressin interfaceRecordReader<K,V> - Returns:
- progress from
0.0to1.0. - Throws:
IOException
-