org.apache.avro.mapreduce
Class AvroKeyValueInputFormat<K,V>

java.lang.Object
  extended by org.apache.hadoop.mapreduce.InputFormat<K,V>
      extended by org.apache.hadoop.mapreduce.lib.input.FileInputFormat<AvroKey<K>,AvroValue<V>>
          extended by org.apache.avro.mapreduce.AvroKeyValueInputFormat<K,V>
Type Parameters:
K - The type of the Avro key to read.
V - The type of the Avro value to read.

public class AvroKeyValueInputFormat<K,V>
extends org.apache.hadoop.mapreduce.lib.input.FileInputFormat<AvroKey<K>,AvroValue<V>>

A MapReduce InputFormat that reads from Avro container files of key/value generic records.

Avro container files that container generic records with the two fields 'key' and 'value' are expected. The contents of the 'key' field will be used as the job input key, and the contents of the 'value' field will be used as the job output value.


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
AvroKeyValueInputFormat()
           
 
Method Summary
 org.apache.hadoop.mapreduce.RecordReader<AvroKey<K>,AvroValue<V>> 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

AvroKeyValueInputFormat

public AvroKeyValueInputFormat()
Method Detail

createRecordReader

public org.apache.hadoop.mapreduce.RecordReader<AvroKey<K>,AvroValue<V>> 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<K>,AvroValue<V>>
Throws:
IOException
InterruptedException


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