@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, setMinInputSplitSize
protected boolean isSplitable(JobContext context, Path file)
FileInputFormat
FileInputFormat
implementations can override this and return
false
to ensure that individual input files are never split-up
so that Mapper
s 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
InputFormat
RecordReader.initialize(InputSplit, TaskAttemptContext)
before
the split is used.createRecordReader
在类中 InputFormat<Text,Text>
genericSplit
- the split to be readcontext
- the information about the taskIOException
Copyright © 2009 The Apache Software Foundation