protected abstract static class AbstractInputFormat.AbstractRecordReader<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:
currentKcurrentVcurrentKey (used for progress reporting)numKeysRead (used for progress reporting)| Modifier and Type | Field and Description |
|---|---|
protected K |
currentK
The Key that should be returned to the client
|
protected Key |
currentKey
The Key that is used to determine progress in the current InputSplit.
|
protected V |
currentV
The Value that should be return to the client
|
protected long |
numKeysRead |
protected Iterator<Map.Entry<Key,Value>> |
scannerIterator |
protected RangeInputSplit |
split |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRecordReader() |
| 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 abstract void |
setupIterators(org.apache.hadoop.mapreduce.TaskAttemptContext context,
Scanner scanner,
String tableName,
RangeInputSplit split)
Configures the iterators on a scanner for the given table name.
|
protected long numKeysRead
protected RangeInputSplit split
protected K currentK
protected V currentV
protected Key currentKey
protected abstract void setupIterators(org.apache.hadoop.mapreduce.TaskAttemptContext context,
Scanner scanner,
String tableName,
RangeInputSplit split)
context - the Hadoop context for the configured jobscanner - the scanner for which to configure the iteratorstableName - the table name for which the scanner is configuredpublic 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>IOExceptionpublic void close()
public float getProgress()
throws IOException
getProgress in class org.apache.hadoop.mapreduce.RecordReader<K,V>IOExceptionpublic K getCurrentKey() throws IOException, InterruptedException
getCurrentKey in class org.apache.hadoop.mapreduce.RecordReader<K,V>IOExceptionInterruptedExceptionpublic V getCurrentValue() throws IOException, InterruptedException
getCurrentValue in class org.apache.hadoop.mapreduce.RecordReader<K,V>IOExceptionInterruptedExceptionCopyright © 2011–2016 The Apache Software Foundation. All rights reserved.