org.apache.pig.impl.util.avro
Class AvroArrayReader

java.lang.Object
  extended by org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.avro.generic.GenericData.Record>
      extended by org.apache.pig.impl.util.avro.AvroArrayReader
All Implemented Interfaces:
Closeable

public final class AvroArrayReader
extends org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.avro.generic.GenericData.Record>

RecordReader for Avro files


Constructor Summary
AvroArrayReader(org.apache.avro.Schema s)
          Creates new instance of AvroRecordReader.
 
Method Summary
 void close()
           
 org.apache.hadoop.io.NullWritable getCurrentKey()
           
 org.apache.avro.generic.GenericData.Record getCurrentValue()
          Returns current value.
 float getProgress()
           
 void initialize(org.apache.hadoop.mapreduce.InputSplit isplit, org.apache.hadoop.mapreduce.TaskAttemptContext tc)
           
 boolean nextKeyValue()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvroArrayReader

public AvroArrayReader(org.apache.avro.Schema s)
Creates new instance of AvroRecordReader.

Parameters:
s - The input schema.
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.avro.generic.GenericData.Record>
Throws:
IOException

getCurrentValue

public org.apache.avro.generic.GenericData.Record getCurrentValue()
                                                           throws IOException,
                                                                  InterruptedException
Returns current value.

Specified by:
getCurrentValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.avro.generic.GenericData.Record>
Returns:
the current value
Throws:
IOException - when an IO error occurs
InterruptedException - when interrupted

getCurrentKey

public org.apache.hadoop.io.NullWritable getCurrentKey()
                                                throws IOException,
                                                       InterruptedException
Specified by:
getCurrentKey in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.avro.generic.GenericData.Record>
Throws:
IOException
InterruptedException

getProgress

public float getProgress()
                  throws IOException,
                         InterruptedException
Specified by:
getProgress in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.avro.generic.GenericData.Record>
Throws:
IOException
InterruptedException

initialize

public void initialize(org.apache.hadoop.mapreduce.InputSplit isplit,
                       org.apache.hadoop.mapreduce.TaskAttemptContext tc)
                throws IOException,
                       InterruptedException
Specified by:
initialize in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.avro.generic.GenericData.Record>
Throws:
IOException
InterruptedException

nextKeyValue

public boolean nextKeyValue()
                     throws IOException,
                            InterruptedException
Specified by:
nextKeyValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.avro.generic.GenericData.Record>
Throws:
IOException
InterruptedException


Copyright © 2007-2012 The Apache Software Foundation