public class CombineFileRecordReader<K,V> extends Object implements RecordReader<K,V>
CombineFileSplit.
A CombineFileSplit can combine data chunks from multiple files.
This class allows using different RecordReaders for processing
these data chunks from different files.CombineFileSplit| 限定符和类型 | 字段和说明 |
|---|---|
protected RecordReader<K,V> |
curReader |
protected FileSystem |
fs |
protected int |
idx |
protected JobConf |
jc |
protected long |
progress |
protected Reporter |
reporter |
protected Class<RecordReader<K,V>> |
rrClass |
protected Constructor<RecordReader<K,V>> |
rrConstructor |
protected CombineFileSplit |
split |
| 构造器和说明 |
|---|
CombineFileRecordReader(JobConf job,
CombineFileSplit split,
Reporter reporter,
Class<RecordReader<K,V>> rrClass)
A generic RecordReader that can hand out different recordReaders
for each chunk in the CombineFileSplit.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Close this
InputSplit to future operations. |
K |
createKey()
Create an object of the appropriate type to be used as a key.
|
V |
createValue()
Create an object of the appropriate type to be used as a value.
|
long |
getPos()
return the amount of data processed
|
float |
getProgress()
return progress based on the amount of data processed so far.
|
protected boolean |
initNextRecordReader()
Get the record reader for the next chunk in this CombineFileSplit.
|
boolean |
next(K key,
V value)
Reads the next key/value pair from the input for processing.
|
protected CombineFileSplit split
protected JobConf jc
protected Reporter reporter
protected Class<RecordReader<K,V>> rrClass
protected Constructor<RecordReader<K,V>> rrConstructor
protected FileSystem fs
protected int idx
protected long progress
protected RecordReader<K,V> curReader
public CombineFileRecordReader(JobConf job, CombineFileSplit split, Reporter reporter, Class<RecordReader<K,V>> rrClass) throws IOException
IOExceptionpublic boolean next(K key, V value) throws IOException
RecordReadernext 在接口中 RecordReader<K,V>key - the key to read data intovalue - the value to read data intoIOExceptionpublic K createKey()
RecordReadercreateKey 在接口中 RecordReader<K,V>public V createValue()
RecordReadercreateValue 在接口中 RecordReader<K,V>public long getPos()
throws IOException
getPos 在接口中 RecordReader<K,V>IOExceptionpublic void close()
throws IOException
RecordReaderInputSplit to future operations.close 在接口中 RecordReader<K,V>IOExceptionpublic float getProgress()
throws IOException
getProgress 在接口中 RecordReader<K,V>0.0 to 1.0.IOExceptionprotected boolean initNextRecordReader()
throws IOException
IOExceptionCopyright © 2009 The Apache Software Foundation