org.apache.avro.mapred
Class AvroAsTextInputFormat

java.lang.Object
  extended by org.apache.hadoop.mapred.FileInputFormat<Text,Text>
      extended by org.apache.avro.mapred.AvroAsTextInputFormat
All Implemented Interfaces:
InputFormat<Text,Text>

public class AvroAsTextInputFormat
extends FileInputFormat<Text,Text>

An InputFormat for Avro data files, which converts each datum to string form in the input key. The input value is always empty. The string representation is JSON.

This InputFormat is useful for applications that wish to process Avro data using tools like MapReduce Streaming.


Field Summary
 
Fields inherited from class org.apache.hadoop.mapred.FileInputFormat
LOG
 
Constructor Summary
AvroAsTextInputFormat()
           
 
Method Summary
 RecordReader<Text,Text> getRecordReader(InputSplit split, JobConf job, Reporter reporter)
           
protected  FileStatus[] listStatus(JobConf job)
           
 
Methods inherited from class org.apache.hadoop.mapred.FileInputFormat
addInputPath, addInputPaths, computeSplitSize, getBlockIndex, getInputPathFilter, getInputPaths, getSplitHosts, getSplits, isSplitable, setInputPathFilter, setInputPaths, setInputPaths, setMinSplitSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvroAsTextInputFormat

public AvroAsTextInputFormat()
Method Detail

listStatus

protected FileStatus[] listStatus(JobConf job)
                           throws IOException
Overrides:
listStatus in class FileInputFormat<Text,Text>
Throws:
IOException

getRecordReader

public RecordReader<Text,Text> getRecordReader(InputSplit split,
                                               JobConf job,
                                               Reporter reporter)
                                        throws IOException
Specified by:
getRecordReader in interface InputFormat<Text,Text>
Specified by:
getRecordReader in class FileInputFormat<Text,Text>
Throws:
IOException


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