org.apache.accumulo.core.client.mapred
Class InputFormatBase.RecordReaderBase<K,V>

java.lang.Object
  extended by org.apache.accumulo.core.client.mapred.InputFormatBase.RecordReaderBase<K,V>
All Implemented Interfaces:
org.apache.hadoop.mapred.RecordReader<K,V>
Enclosing class:
InputFormatBase<K,V>

protected abstract static class InputFormatBase.RecordReaderBase<K,V>
extends Object
implements org.apache.hadoop.mapred.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.next(Object, Object) to update key and value, and also to update the following variables:


Field Summary
protected  Key currentKey
           
protected  long numKeysRead
           
protected  Iterator<Map.Entry<Key,Value>> scannerIterator
           
protected  InputFormatBase.RangeInputSplit split
           
 
Constructor Summary
protected InputFormatBase.RecordReaderBase()
           
 
Method Summary
 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  void setupIterators(org.apache.hadoop.mapred.JobConf job, Scanner scanner)
          Apply the configured iterators from the configuration to the scanner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.mapred.RecordReader
createKey, createValue, next
 

Field Detail

numKeysRead

protected long numKeysRead

scannerIterator

protected Iterator<Map.Entry<Key,Value>> scannerIterator

split

protected InputFormatBase.RangeInputSplit split

currentKey

protected Key currentKey
Constructor Detail

InputFormatBase.RecordReaderBase

protected InputFormatBase.RecordReaderBase()
Method Detail

setupIterators

protected void setupIterators(org.apache.hadoop.mapred.JobConf job,
                              Scanner scanner)
Apply the configured iterators from the configuration to the scanner.

Parameters:
job - the Hadoop context for the configured job
scanner - the scanner to configure

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()
Specified by:
close in interface org.apache.hadoop.mapred.RecordReader<K,V>

getPos

public long getPos()
            throws IOException
Specified by:
getPos in interface org.apache.hadoop.mapred.RecordReader<K,V>
Throws:
IOException

getProgress

public float getProgress()
                  throws IOException
Specified by:
getProgress in interface org.apache.hadoop.mapred.RecordReader<K,V>
Throws:
IOException


Copyright © 2013 Apache Accumulo Project. All Rights Reserved.