protected abstract static class InputFormatBase.RecordReaderBase<K,V>
extends org.apache.hadoop.mapreduce.RecordReader<K,V>
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:
currentK
currentV
currentKey
(used for progress reporting)numKeysRead
(used for progress reporting)Modifier and Type | Field and Description |
---|---|
protected K |
currentK |
protected Key |
currentKey |
protected V |
currentV |
protected Value |
currentValue |
protected long |
numKeysRead |
protected Iterator<Map.Entry<Key,Value>> |
scannerIterator |
protected RangeInputSplit |
split |
Modifier | Constructor and Description |
---|---|
protected |
InputFormatBase.RecordReaderBase() |
Modifier and Type | Method and Description |
---|---|
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(List<IteratorSetting> iterators,
Scanner scanner)
Apply the configured iterators to the scanner.
|
protected void |
setupIterators(org.apache.hadoop.mapreduce.TaskAttemptContext context,
Scanner scanner)
Apply the configured iterators from the configuration to the scanner.
|
protected long numKeysRead
protected RangeInputSplit split
protected K currentK
protected V currentV
protected Key currentKey
protected Value currentValue
protected void setupIterators(List<IteratorSetting> iterators, Scanner scanner)
iterators
- the iterators to configurescanner
- the scanner to configureprotected void setupIterators(org.apache.hadoop.mapreduce.TaskAttemptContext context, Scanner scanner)
context
- the iterators to configurescanner
- the scanner to configurepublic void initialize(org.apache.hadoop.mapreduce.InputSplit inSplit, org.apache.hadoop.mapreduce.TaskAttemptContext attempt) throws IOException
initialize
in class org.apache.hadoop.mapreduce.RecordReader<K,V>
IOException
public void close()
public float getProgress() throws IOException
getProgress
in class org.apache.hadoop.mapreduce.RecordReader<K,V>
IOException
public K getCurrentKey() throws IOException, InterruptedException
getCurrentKey
in class org.apache.hadoop.mapreduce.RecordReader<K,V>
IOException
InterruptedException
public V getCurrentValue() throws IOException, InterruptedException
getCurrentValue
in class org.apache.hadoop.mapreduce.RecordReader<K,V>
IOException
InterruptedException
Copyright © 2011-2016 The Apache Software Foundation. All Rights Reserved.