org.apache.hadoop.hive.ql.io
Class HiveRecordReader<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>

java.lang.Object
  extended by org.apache.hadoop.hive.ql.io.HiveContextAwareRecordReader<K,V>
      extended by org.apache.hadoop.hive.ql.io.HiveRecordReader<K,V>
All Implemented Interfaces:
org.apache.hadoop.mapred.RecordReader<K,V>

public class HiveRecordReader<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>
extends HiveContextAwareRecordReader<K,V>

HiveRecordReader is a simple wrapper on RecordReader. It allows us to stop reading the data when some global flag ExecMapper.getDone() is set.


Constructor Summary
HiveRecordReader(org.apache.hadoop.mapred.RecordReader recordReader)
           
 
Method Summary
 K createKey()
           
 V createValue()
           
 void doClose()
          Close this InputSplit to future operations.
 boolean doNext(K key, V value)
          Reads the next key/value pair from the input for processing.
 long getPos()
           
 float getProgress()
           
 
Methods inherited from class org.apache.hadoop.hive.ql.io.HiveContextAwareRecordReader
close, getIOContext, initIOContext, initIOContext, initIOContext, next, updateIOContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HiveRecordReader

public HiveRecordReader(org.apache.hadoop.mapred.RecordReader recordReader)
                 throws IOException
Throws:
IOException
Method Detail

doClose

public void doClose()
             throws IOException
Description copied from class: HiveContextAwareRecordReader
Close this InputSplit to future operations.

Specified by:
doClose in class HiveContextAwareRecordReader<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>
Throws:
IOException

createKey

public K createKey()

createValue

public V createValue()

getPos

public long getPos()
            throws IOException
Throws:
IOException

getProgress

public float getProgress()
                  throws IOException
Throws:
IOException

doNext

public boolean doNext(K key,
                      V value)
               throws IOException
Description copied from class: HiveContextAwareRecordReader
Reads the next key/value pair from the input for processing.

Specified by:
doNext in class HiveContextAwareRecordReader<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>
Parameters:
key - the key to read data into
value - the value to read data into
Returns:
true if a key/value was read, false if at EOF
Throws:
IOException


Copyright © 2011 The Apache Software Foundation