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:
currentK
currentV
currentKey
(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 ScannerBase |
scannerBase |
protected Iterator<Map.Entry<Key,Value>> |
scannerIterator |
protected RangeInputSplit |
split |
Modifier | Constructor and Description |
---|---|
protected |
AbstractRecordReader() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected abstract List<IteratorSetting> |
contextIterators(org.apache.hadoop.mapreduce.TaskAttemptContext context,
String tableName)
Extracts Iterators settings from the context to be used by RecordReader.
|
K |
getCurrentKey() |
V |
getCurrentValue() |
float |
getProgress() |
void |
initialize(org.apache.hadoop.mapreduce.InputSplit inSplit,
org.apache.hadoop.mapreduce.TaskAttemptContext attempt) |
protected void |
setupIterators(org.apache.hadoop.mapreduce.TaskAttemptContext context,
Scanner scanner,
String tableName,
RangeInputSplit split)
Deprecated.
since 1.7.0; Use
contextIterators(org.apache.hadoop.mapreduce.TaskAttemptContext, java.lang.String) instead. |
protected long numKeysRead
protected ScannerBase scannerBase
protected RangeInputSplit split
protected K currentK
protected V currentV
protected Key currentKey
protected abstract List<IteratorSetting> contextIterators(org.apache.hadoop.mapreduce.TaskAttemptContext context, String tableName)
context
- the Hadoop context for the configured jobtableName
- the table name for which the scanner is configured@Deprecated protected void setupIterators(org.apache.hadoop.mapreduce.TaskAttemptContext context, Scanner scanner, String tableName, RangeInputSplit split)
contextIterators(org.apache.hadoop.mapreduce.TaskAttemptContext, java.lang.String)
instead.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>
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–2018 The Apache Software Foundation. All rights reserved.