org.apache.hadoop.mapred
Class KeyValueTextInputFormat

java.lang.Object
  extended by org.apache.hadoop.mapred.FileInputFormat
      extended by org.apache.hadoop.mapred.TextInputFormat
          extended by org.apache.hadoop.mapred.KeyValueTextInputFormat
All Implemented Interfaces:
InputFormat, JobConfigurable
Direct Known Subclasses:
StreamInputFormat

public class KeyValueTextInputFormat
extends TextInputFormat

An InputFormat for plain text files. Files are broken into lines. Either linefeed or carriage-return are used to signal end of line. Each line is divided into key and value parts by a separator byte. If no such a byte exists, the key will be the entire line and value will be empty.


Field Summary
 
Fields inherited from class org.apache.hadoop.mapred.FileInputFormat
LOG
 
Constructor Summary
KeyValueTextInputFormat()
           
 
Method Summary
 RecordReader getRecordReader(InputSplit genericSplit, JobConf job, Reporter reporter)
          Construct a RecordReader for a FileSplit.
 
Methods inherited from class org.apache.hadoop.mapred.TextInputFormat
configure, isSplitable
 
Methods inherited from class org.apache.hadoop.mapred.FileInputFormat
getSplits, listPaths, setMinSplitSize, validateInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyValueTextInputFormat

public KeyValueTextInputFormat()
Method Detail

getRecordReader

public RecordReader getRecordReader(InputSplit genericSplit,
                                    JobConf job,
                                    Reporter reporter)
                             throws IOException
Description copied from interface: InputFormat
Construct a RecordReader for a FileSplit.

Specified by:
getRecordReader in interface InputFormat
Overrides:
getRecordReader in class TextInputFormat
Parameters:
genericSplit - the InputSplit
job - the job that this split belongs to
Returns:
a RecordReader
Throws:
IOException


Copyright © 2006 The Apache Software Foundation