Class AbstractInputFormat.AbstractRecordReader<K,V>
- java.lang.Object
-
- org.apache.accumulo.core.client.mapred.AbstractInputFormat.AbstractRecordReader<K,V>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.hadoop.mapred.RecordReader<K,V>
- Direct Known Subclasses:
InputFormatBase.RecordReaderBase
- Enclosing class:
- AbstractInputFormat<K,V>
protected abstract static class AbstractInputFormat.AbstractRecordReader<K,V> extends Object implements org.apache.hadoop.mapred.RecordReader<K,V>
An abstract base class to be used to createRecordReader
instances that convert from AccumuloKey
/Value
pairs to the user's K/V types. Subclasses must implementRecordReader.next(Object, Object)
to update key and value, and also to update the following variables:- Key
currentKey
(used for progress reporting) - int
numKeysRead
(used for progress reporting)
-
-
Field Summary
Fields Modifier and Type Field Description protected Key
currentKey
protected long
numKeysRead
protected ScannerBase
scannerBase
protected Iterator<Map.Entry<Key,Value>>
scannerIterator
protected RangeInputSplit
split
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractRecordReader()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
long
getPos()
float
getProgress()
void
initialize(org.apache.hadoop.mapred.InputSplit inSplit, org.apache.hadoop.mapred.JobConf job)
Initialize a scanner over the given input split using this task attempt configuration.protected abstract List<IteratorSetting>
jobIterators(org.apache.hadoop.mapred.JobConf job, String tableName)
Extracts Iterators settings from the context to be used by RecordReader.protected void
setupIterators(org.apache.hadoop.mapred.JobConf job, Scanner scanner, String tableName, RangeInputSplit split)
Deprecated.since 1.7.0; UsejobIterators(org.apache.hadoop.mapred.JobConf, java.lang.String)
instead.
-
-
-
Field Detail
-
numKeysRead
protected long numKeysRead
-
split
protected RangeInputSplit split
-
scannerBase
protected ScannerBase scannerBase
-
currentKey
protected Key currentKey
-
-
Method Detail
-
jobIterators
protected abstract List<IteratorSetting> jobIterators(org.apache.hadoop.mapred.JobConf job, String tableName)
Extracts Iterators settings from the context to be used by RecordReader.- Parameters:
job
- the Hadoop job configurationtableName
- the table name for which the scanner is configured- Returns:
- List of iterator settings for given table
- Since:
- 1.7.0
-
setupIterators
@Deprecated protected void setupIterators(org.apache.hadoop.mapred.JobConf job, Scanner scanner, String tableName, RangeInputSplit split)
Deprecated.since 1.7.0; UsejobIterators(org.apache.hadoop.mapred.JobConf, java.lang.String)
instead.Configures the iterators on a scanner for the given table name.- Parameters:
job
- the Hadoop job configurationscanner
- the scanner for which to configure the iteratorstableName
- the table name for which the scanner is configured- Since:
- 1.6.0
-
initialize
public void initialize(org.apache.hadoop.mapred.InputSplit inSplit, org.apache.hadoop.mapred.JobConf job) throws IOException
Initialize a scanner over the given input split using this task attempt configuration.- Throws:
IOException
-
close
public void close()
-
getPos
public long getPos() throws IOException
- Specified by:
getPos
in interfaceorg.apache.hadoop.mapred.RecordReader<K,V>
- Throws:
IOException
-
getProgress
public float getProgress() throws IOException
- Specified by:
getProgress
in interfaceorg.apache.hadoop.mapred.RecordReader<K,V>
- Throws:
IOException
-
-