@InterfaceAudience.Public @InterfaceStability.Stable public class CombineFileRecordReader<K,V> extends 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 TaskAttemptContext |
context |
protected RecordReader<K,V> |
curReader |
protected FileSystem |
fs |
protected int |
idx |
protected long |
progress |
protected Class<? extends RecordReader<K,V>> |
rrClass |
protected Constructor<? extends RecordReader<K,V>> |
rrConstructor |
protected CombineFileSplit |
split |
构造器和说明 |
---|
CombineFileRecordReader(CombineFileSplit split,
TaskAttemptContext context,
Class<? extends RecordReader<K,V>> rrClass)
A generic RecordReader that can hand out different recordReaders
for each chunk in the CombineFileSplit.
|
限定符和类型 | 方法和说明 |
---|---|
void |
close()
Close the record reader.
|
K |
getCurrentKey()
Get the current key
|
V |
getCurrentValue()
Get the current value.
|
float |
getProgress()
return progress based on the amount of data processed so far.
|
void |
initialize(InputSplit split,
TaskAttemptContext context)
Called once at initialization.
|
protected boolean |
initNextRecordReader()
Get the record reader for the next chunk in this CombineFileSplit.
|
boolean |
nextKeyValue()
Read the next key, value pair.
|
protected CombineFileSplit split
protected Class<? extends RecordReader<K,V>> rrClass
protected Constructor<? extends RecordReader<K,V>> rrConstructor
protected FileSystem fs
protected TaskAttemptContext context
protected int idx
protected long progress
protected RecordReader<K,V> curReader
public CombineFileRecordReader(CombineFileSplit split, TaskAttemptContext context, Class<? extends RecordReader<K,V>> rrClass) throws IOException
IOException
public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException
RecordReader
initialize
在类中 RecordReader<K,V>
split
- the split that defines the range of records to readcontext
- the information about the taskIOException
InterruptedException
public boolean nextKeyValue() throws IOException, InterruptedException
RecordReader
nextKeyValue
在类中 RecordReader<K,V>
IOException
InterruptedException
public K getCurrentKey() throws IOException, InterruptedException
RecordReader
getCurrentKey
在类中 RecordReader<K,V>
IOException
InterruptedException
public V getCurrentValue() throws IOException, InterruptedException
RecordReader
getCurrentValue
在类中 RecordReader<K,V>
IOException
InterruptedException
public void close() throws IOException
RecordReader
close
在接口中 Closeable
close
在接口中 AutoCloseable
close
在类中 RecordReader<K,V>
IOException
public float getProgress() throws IOException, InterruptedException
getProgress
在类中 RecordReader<K,V>
IOException
InterruptedException
protected boolean initNextRecordReader() throws IOException
IOException
Copyright © 2009 The Apache Software Foundation