public class NLineInputFormat extends FileInputFormat<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text> implements JobConfigurable
LOG| Constructor and Description |
|---|
NLineInputFormat() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(JobConf conf)
Initializes a new instance from a
JobConf. |
protected static FileSplit |
createFileSplit(org.apache.hadoop.fs.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<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.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, setMinSplitSizepublic RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text> getRecordReader(InputSplit genericSplit, JobConf job, Reporter reporter) throws java.io.IOException
InputFormatRecordReader 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 in interface InputFormat<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>getRecordReader in class FileInputFormat<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>genericSplit - the InputSplitjob - the job that this split belongs toRecordReaderjava.io.IOExceptionpublic InputSplit[] getSplits(JobConf job, int numSplits) throws java.io.IOException
getSplits in interface InputFormat<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>getSplits in class FileInputFormat<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>job - job configuration.numSplits - the desired number of splits, a hint.InputSplits for the job.java.io.IOExceptionFileInputFormat.getSplits(JobConf, int)protected static FileSplit createFileSplit(org.apache.hadoop.fs.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)
JobConfigurableJobConf.configure in interface JobConfigurableconf - the configurationCopyright © 2009 The Apache Software Foundation