@InterfaceAudience.Public @InterfaceStability.Stable public class KeyValueTextInputFormat extends FileInputFormat<Text,Text>
InputFormat for plain text files. Files are broken into lines.
Either line feed 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.FileInputFormat.Counter| 构造器和说明 |
|---|
KeyValueTextInputFormat() |
| 限定符和类型 | 方法和说明 |
|---|---|
RecordReader<Text,Text> |
createRecordReader(InputSplit genericSplit,
TaskAttemptContext context)
Create a record reader for a given split.
|
protected boolean |
isSplitable(JobContext context,
Path file)
Is the given filename splitable?
|
addInputPath, addInputPaths, computeSplitSize, getBlockIndex, getFormatMinSplitSize, getInputPathFilter, getInputPaths, getMaxSplitSize, getMinSplitSize, getSplits, listStatus, setInputPathFilter, setInputPaths, setInputPaths, setMaxInputSplitSize, setMinInputSplitSizeprotected boolean isSplitable(JobContext context, Path file)
FileInputFormatFileInputFormat implementations can override this and return
false to ensure that individual input files are never split-up
so that Mappers process entire files.isSplitable 在类中 FileInputFormat<Text,Text>context - the job contextfile - the file name to checkpublic RecordReader<Text,Text> createRecordReader(InputSplit genericSplit, TaskAttemptContext context) throws IOException
InputFormatRecordReader.initialize(InputSplit, TaskAttemptContext) before
the split is used.createRecordReader 在类中 InputFormat<Text,Text>genericSplit - the split to be readcontext - the information about the taskIOExceptionCopyright © 2009 The Apache Software Foundation