org.apache.avro.mapreduce
Class AvroKeyInputFormat<T>

java.lang.Object
  extended by org.apache.hadoop.mapreduce.InputFormat<K,V>
      extended by org.apache.hadoop.mapreduce.lib.input.FileInputFormat<AvroKey<T>,org.apache.hadoop.io.NullWritable>
          extended by org.apache.avro.mapreduce.AvroKeyInputFormat<T>

public class AvroKeyInputFormat<T>
extends org.apache.hadoop.mapreduce.lib.input.FileInputFormat<AvroKey<T>,org.apache.hadoop.io.NullWritable>

A MapReduce InputFormat that can handle Avro container files.

Keys are AvroKey wrapper objects that contain the Avro data. Since Avro container files store only records (not key/value pairs), the value from this InputFormat is a NullWritable.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.lib.input.FileInputFormat
org.apache.hadoop.mapreduce.lib.input.FileInputFormat.Counter
 
Constructor Summary
AvroKeyInputFormat()
           
 
Method Summary
 org.apache.hadoop.mapreduce.RecordReader<AvroKey<T>,org.apache.hadoop.io.NullWritable> createRecordReader(org.apache.hadoop.mapreduce.InputSplit split, org.apache.hadoop.mapreduce.TaskAttemptContext context)
          
 
Methods inherited from class org.apache.hadoop.mapreduce.lib.input.FileInputFormat
addInputPath, addInputPaths, computeSplitSize, getBlockIndex, getFormatMinSplitSize, getInputPathFilter, getInputPaths, getMaxSplitSize, getMinSplitSize, getSplits, isSplitable, listStatus, setInputPathFilter, setInputPaths, setInputPaths, setMaxInputSplitSize, setMinInputSplitSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvroKeyInputFormat

public AvroKeyInputFormat()
Method Detail

createRecordReader

public org.apache.hadoop.mapreduce.RecordReader<AvroKey<T>,org.apache.hadoop.io.NullWritable> createRecordReader(org.apache.hadoop.mapreduce.InputSplit split,
                                                                                                                 org.apache.hadoop.mapreduce.TaskAttemptContext context)
                                                                                                          throws IOException,
                                                                                                                 InterruptedException

Specified by:
createRecordReader in class org.apache.hadoop.mapreduce.InputFormat<AvroKey<T>,org.apache.hadoop.io.NullWritable>
Throws:
IOException
InterruptedException


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.