org.apache.hadoop.mapred
Class KeyValueTextInputFormat
java.lang.Object
   org.apache.hadoop.mapred.FileInputFormat<Text,Text>
org.apache.hadoop.mapred.FileInputFormat<Text,Text>
       org.apache.hadoop.mapred.KeyValueTextInputFormat
org.apache.hadoop.mapred.KeyValueTextInputFormat
- All Implemented Interfaces: 
- InputFormat<Text,Text>, JobConfigurable
- Direct Known Subclasses: 
- StreamInputFormat
- public class KeyValueTextInputFormat 
- extends FileInputFormat<Text,Text>- implements JobConfigurable
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.
 
 
 
 
 
 
| Methods inherited from class org.apache.hadoop.mapred.FileInputFormat | 
| addInputPath, addInputPaths, computeSplitSize, getBlockIndex, getInputPathFilter, getInputPaths, getSplitHosts, getSplits, listStatus, setInputPathFilter, setInputPaths, setInputPaths, setMinSplitSize | 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
KeyValueTextInputFormat
public KeyValueTextInputFormat()
configure
public void configure(JobConf conf)
- Description copied from interface: JobConfigurable
- Initializes a new instance from a JobConf.
 
- 
- Specified by:
- configurein interface- JobConfigurable
 
- 
- Parameters:
- conf- the configuration
 
isSplitable
protected boolean isSplitable(FileSystem fs,
                              Path file)
- Description copied from class: FileInputFormat
- Is the given filename splitable? Usually, true, but if the file is
 stream compressed, it will not be.
 
 FileInputFormatimplementations can override this and returnfalseto ensure that individual input files are never split-up
 so thatMappers process entire files.
 
- 
- Overrides:
- isSplitablein class- FileInputFormat<Text,Text>
 
- 
- Parameters:
- fs- the file system that the file is on
- file- the file name to check
- Returns:
- is this file splitable?
 
getRecordReader
public RecordReader<Text,Text> getRecordReader(InputSplit genericSplit,
                                               JobConf job,
                                               Reporter reporter)
                                        throws IOException
- Description copied from interface: InputFormat
- Get the RecordReaderfor the givenInputSplit.It is the responsibility of the RecordReaderto respect
 record boundaries while processing the logical split to present a 
 record-oriented view to the individual task.
 
 
- 
- Specified by:
- getRecordReaderin interface- InputFormat<Text,Text>
- Specified by:
- getRecordReaderin class- FileInputFormat<Text,Text>
 
- 
- Parameters:
- genericSplit- the- InputSplit
- job- the job that this split belongs to
- Returns:
- a RecordReader
- Throws:
- IOException
 
Copyright © 2009 The Apache Software Foundation