public class NLineInputFormat extends FileInputFormat<LongWritable,Text> implements JobConfigurable
FileInputFormat.Counter
LOG
构造器和说明 |
---|
NLineInputFormat() |
限定符和类型 | 方法和说明 |
---|---|
void |
configure(JobConf conf)
Initializes a new instance from a
JobConf . |
protected static FileSplit |
createFileSplit(Path fileName,
long begin,
long length)
NLineInputFormat uses LineRecordReader, which always reads
(and consumes) at least one character out of its upper split
boundary.
|
RecordReader<LongWritable,Text> |
getRecordReader(InputSplit genericSplit,
JobConf job,
Reporter reporter)
Get the
RecordReader for the given InputSplit . |
InputSplit[] |
getSplits(JobConf job,
int numSplits)
Logically splits the set of input files for the job, splits N lines
of the input as one split.
|
addInputPath, addInputPaths, computeSplitSize, getBlockIndex, getInputPathFilter, getInputPaths, getSplitHosts, isSplitable, listStatus, setInputPathFilter, setInputPaths, setInputPaths, setMinSplitSize
public RecordReader<LongWritable,Text> getRecordReader(InputSplit genericSplit, JobConf job, Reporter reporter) throws IOException
InputFormat
RecordReader
for the given InputSplit
.
It is the responsibility of the RecordReader
to respect
record boundaries while processing the logical split to present a
record-oriented view to the individual task.
getRecordReader
在接口中 InputFormat<LongWritable,Text>
getRecordReader
在类中 FileInputFormat<LongWritable,Text>
genericSplit
- the InputSplit
job
- the job that this split belongs toRecordReader
IOException
public InputSplit[] getSplits(JobConf job, int numSplits) throws IOException
getSplits
在接口中 InputFormat<LongWritable,Text>
getSplits
在类中 FileInputFormat<LongWritable,Text>
job
- job configuration.numSplits
- the desired number of splits, a hint.InputSplit
s for the job.IOException
FileInputFormat.getSplits(JobConf, int)
protected static FileSplit createFileSplit(Path fileName, long begin, long length)
fileName
- Path of filebegin
- the position of the first byte in the file to processlength
- number of bytes in InputSplitpublic void configure(JobConf conf)
JobConfigurable
JobConf
.configure
在接口中 JobConfigurable
conf
- the configurationCopyright © 2009 The Apache Software Foundation