This project has retired. For details please refer to its Attic page.
AvroRecordReader (Apache Crunch 0.4.0-incubating API)

org.apache.crunch.types.avro
Class AvroRecordReader<T>

java.lang.Object
  extended by org.apache.hadoop.mapreduce.RecordReader<org.apache.avro.mapred.AvroWrapper<T>,org.apache.hadoop.io.NullWritable>
      extended by org.apache.crunch.types.avro.AvroRecordReader<T>
All Implemented Interfaces:
Closeable

public class AvroRecordReader<T>
extends org.apache.hadoop.mapreduce.RecordReader<org.apache.avro.mapred.AvroWrapper<T>,org.apache.hadoop.io.NullWritable>

An RecordReader for Avro data files.


Constructor Summary
AvroRecordReader(org.apache.avro.Schema schema)
           
 
Method Summary
 void close()
           
 org.apache.avro.mapred.AvroWrapper<T> getCurrentKey()
           
 org.apache.hadoop.io.NullWritable getCurrentValue()
           
 long getPos()
           
 float getProgress()
           
 void initialize(org.apache.hadoop.mapreduce.InputSplit genericSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context)
           
 boolean nextKeyValue()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvroRecordReader

public AvroRecordReader(org.apache.avro.Schema schema)
Method Detail

initialize

public void initialize(org.apache.hadoop.mapreduce.InputSplit genericSplit,
                       org.apache.hadoop.mapreduce.TaskAttemptContext context)
                throws IOException,
                       InterruptedException
Specified by:
initialize in class org.apache.hadoop.mapreduce.RecordReader<org.apache.avro.mapred.AvroWrapper<T>,org.apache.hadoop.io.NullWritable>
Throws:
IOException
InterruptedException

nextKeyValue

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

getCurrentKey

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

getCurrentValue

public org.apache.hadoop.io.NullWritable getCurrentValue()
                                                  throws IOException,
                                                         InterruptedException
Specified by:
getCurrentValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.avro.mapred.AvroWrapper<T>,org.apache.hadoop.io.NullWritable>
Throws:
IOException
InterruptedException

getProgress

public float getProgress()
                  throws IOException
Specified by:
getProgress in class org.apache.hadoop.mapreduce.RecordReader<org.apache.avro.mapred.AvroWrapper<T>,org.apache.hadoop.io.NullWritable>
Throws:
IOException

getPos

public long getPos()
            throws IOException
Throws:
IOException

close

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


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.