|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapreduce.RecordReader<K,V> org.apache.hadoop.mapreduce.lib.input.CombineFileRecordReader<K,V>
@InterfaceAudience.Public @InterfaceStability.Stable public class CombineFileRecordReader<K,V>
A generic RecordReader that can hand out different recordReaders
for each chunk in a 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
Field Summary | |
---|---|
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
|
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public CombineFileRecordReader(CombineFileSplit split, TaskAttemptContext context, Class<? extends RecordReader<K,V>> rrClass) throws IOException
IOException
Method Detail |
---|
public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException
RecordReader
initialize
in class RecordReader<K,V>
split
- the split that defines the range of records to readcontext
- the information about the task
IOException
InterruptedException
public boolean nextKeyValue() throws IOException, InterruptedException
RecordReader
nextKeyValue
in class RecordReader<K,V>
IOException
InterruptedException
public K getCurrentKey() throws IOException, InterruptedException
RecordReader
getCurrentKey
in class RecordReader<K,V>
IOException
InterruptedException
public V getCurrentValue() throws IOException, InterruptedException
RecordReader
getCurrentValue
in class RecordReader<K,V>
IOException
InterruptedException
public void close() throws IOException
RecordReader
close
in interface Closeable
close
in class RecordReader<K,V>
IOException
public float getProgress() throws IOException, InterruptedException
getProgress
in class RecordReader<K,V>
IOException
InterruptedException
protected boolean initNextRecordReader() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |