org.apache.hadoop.hive.ql.io.avro
Class AvroGenericRecordReader

java.lang.Object
  extended by org.apache.hadoop.hive.ql.io.avro.AvroGenericRecordReader
All Implemented Interfaces:
org.apache.hadoop.mapred.JobConfigurable, org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.NullWritable,AvroGenericRecordWritable>

public class AvroGenericRecordReader
extends Object
implements org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.NullWritable,AvroGenericRecordWritable>, org.apache.hadoop.mapred.JobConfigurable

RecordReader optimized against Avro GenericRecords that returns to record as the value of the k-v pair, as Hive requires.


Field Summary
protected  org.apache.hadoop.mapred.JobConf jobConf
           
 
Constructor Summary
AvroGenericRecordReader(org.apache.hadoop.mapred.JobConf job, org.apache.hadoop.mapred.FileSplit split, org.apache.hadoop.mapred.Reporter reporter)
           
 
Method Summary
 void close()
           
 void configure(org.apache.hadoop.mapred.JobConf jobConf)
           
 org.apache.hadoop.io.NullWritable createKey()
           
 AvroGenericRecordWritable createValue()
           
 long getPos()
           
 float getProgress()
           
 boolean next(org.apache.hadoop.io.NullWritable nullWritable, AvroGenericRecordWritable record)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jobConf

protected org.apache.hadoop.mapred.JobConf jobConf
Constructor Detail

AvroGenericRecordReader

public AvroGenericRecordReader(org.apache.hadoop.mapred.JobConf job,
                               org.apache.hadoop.mapred.FileSplit split,
                               org.apache.hadoop.mapred.Reporter reporter)
                        throws IOException
Throws:
IOException
Method Detail

next

public boolean next(org.apache.hadoop.io.NullWritable nullWritable,
                    AvroGenericRecordWritable record)
             throws IOException
Specified by:
next in interface org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.NullWritable,AvroGenericRecordWritable>
Throws:
IOException

createKey

public org.apache.hadoop.io.NullWritable createKey()
Specified by:
createKey in interface org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.NullWritable,AvroGenericRecordWritable>

createValue

public AvroGenericRecordWritable createValue()
Specified by:
createValue in interface org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.NullWritable,AvroGenericRecordWritable>

getPos

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

close

public void close()
           throws IOException
Specified by:
close in interface org.apache.hadoop.mapred.RecordReader<org.apache.hadoop.io.NullWritable,AvroGenericRecordWritable>
Throws:
IOException

getProgress

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

configure

public void configure(org.apache.hadoop.mapred.JobConf jobConf)
Specified by:
configure in interface org.apache.hadoop.mapred.JobConfigurable


Copyright © 2011 The Apache Software Foundation