org.apache.avro.mapreduce.lib.input
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.avro.mapreduce.lib.input.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.hadoop.conf.Configuration conf, org.apache.hadoop.mapreduce.lib.input.FileSplit split)
           
 
Method Summary
 void close()
           
 org.apache.avro.mapred.AvroWrapper<T> getCurrentKey()
           
 org.apache.hadoop.io.NullWritable getCurrentValue()
           
 long getPos()
           
 float getProgress()
           
protected  void init(org.apache.avro.file.FileReader<T> reader, org.apache.hadoop.mapreduce.lib.input.FileSplit split)
           
 void initialize(org.apache.hadoop.mapreduce.lib.input.FileSplit split, org.apache.hadoop.conf.Configuration conf)
           
 void initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext context)
           
 boolean nextKeyValue()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvroRecordReader

public AvroRecordReader(org.apache.hadoop.conf.Configuration conf,
                        org.apache.hadoop.mapreduce.lib.input.FileSplit split)
                 throws IOException,
                        InterruptedException
Throws:
IOException
InterruptedException
Method Detail

initialize

public void initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit,
                       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

initialize

public void initialize(org.apache.hadoop.mapreduce.lib.input.FileSplit split,
                       org.apache.hadoop.conf.Configuration conf)
                throws IOException,
                       InterruptedException
Throws:
IOException
InterruptedException

init

protected void init(org.apache.avro.file.FileReader<T> reader,
                    org.apache.hadoop.mapreduce.lib.input.FileSplit split)
             throws IOException
Throws:
IOException

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

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

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


Copyright © –2014 Datasalt Systems S.L.. All rights reserved.