JobConf job = new JobConf(defaultConf);
localFs.delete(workDir, true);
writeFile(localFs, new Path(workDir, "test.txt"),
"the quick\nbrown\nfox jumped\nover\n the lazy\n dog\n");
FileInputFormat.setInputPaths(job, workDir);
CombineFileInputFormat format = new CombineFileInputFormat() {
@Override
public RecordReader getRecordReader(InputSplit split, JobConf job, Reporter reporter) throws IOException {
return new CombineFileRecordReader(job, (CombineFileSplit)split, reporter, CombineFileRecordReader.class);
}
};
final int SIZE_SPLITS = 1;
LOG.info("Trying to getSplits with splits = " + SIZE_SPLITS);
InputSplit[] splits = format.getSplits(job, SIZE_SPLITS);
LOG.info("Got getSplits = " + splits.length);
assertEquals("splits == " + SIZE_SPLITS, SIZE_SPLITS, splits.length);
}