org.apache.accumulo.core.client.mapreduce
Class InputFormatBase.RecordReaderBase<K,V>
java.lang.Object
org.apache.hadoop.mapreduce.RecordReader<K,V>
org.apache.accumulo.core.client.mapreduce.InputFormatBase.RecordReaderBase<K,V>
- All Implemented Interfaces:
- Closeable
- Enclosing class:
- InputFormatBase<K,V>
protected abstract static class InputFormatBase.RecordReaderBase<K,V>
- extends org.apache.hadoop.mapreduce.RecordReader<K,V>
An abstract base class to be used to create RecordReader
instances that convert from Accumulo Key
/Value
pairs to the user's K/V
types.
Subclasses must implement RecordReader.nextKeyValue()
and use it to update the following variables:
Method Summary |
void |
close()
|
K |
getCurrentKey()
|
V |
getCurrentValue()
|
float |
getProgress()
|
void |
initialize(org.apache.hadoop.mapreduce.InputSplit inSplit,
org.apache.hadoop.mapreduce.TaskAttemptContext attempt)
Initialize a scanner over the given input split using this task attempt configuration. |
protected void |
setupIterators(org.apache.hadoop.mapreduce.TaskAttemptContext context,
Scanner scanner)
Apply the configured iterators from the configuration to the scanner. |
Methods inherited from class org.apache.hadoop.mapreduce.RecordReader |
nextKeyValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
numKeysRead
protected long numKeysRead
scannerIterator
protected Iterator<Map.Entry<Key,Value>> scannerIterator
split
protected InputFormatBase.RangeInputSplit split
currentK
protected K currentK
currentV
protected V currentV
currentKey
protected Key currentKey
currentValue
protected Value currentValue
InputFormatBase.RecordReaderBase
protected InputFormatBase.RecordReaderBase()
setupIterators
protected void setupIterators(org.apache.hadoop.mapreduce.TaskAttemptContext context,
Scanner scanner)
- Apply the configured iterators from the configuration to the scanner.
- Parameters:
context
- the Hadoop context for the configured jobscanner
- the scanner to configure
initialize
public void initialize(org.apache.hadoop.mapreduce.InputSplit inSplit,
org.apache.hadoop.mapreduce.TaskAttemptContext attempt)
throws IOException
- Initialize a scanner over the given input split using this task attempt configuration.
- Specified by:
initialize
in class org.apache.hadoop.mapreduce.RecordReader<K,V>
- Throws:
IOException
close
public void close()
- Specified by:
close
in interface Closeable
- Specified by:
close
in class org.apache.hadoop.mapreduce.RecordReader<K,V>
getProgress
public float getProgress()
throws IOException
- Specified by:
getProgress
in class org.apache.hadoop.mapreduce.RecordReader<K,V>
- Throws:
IOException
getCurrentKey
public K getCurrentKey()
throws IOException,
InterruptedException
- Specified by:
getCurrentKey
in class org.apache.hadoop.mapreduce.RecordReader<K,V>
- Throws:
IOException
InterruptedException
getCurrentValue
public V getCurrentValue()
throws IOException,
InterruptedException
- Specified by:
getCurrentValue
in class org.apache.hadoop.mapreduce.RecordReader<K,V>
- Throws:
IOException
InterruptedException
Copyright © 2013 Apache Accumulo Project. All Rights Reserved.