}
@Override
protected void runJob(JobConf job) throws IOException {
// retrieve the splits
TextInputFormat input = (TextInputFormat) job.getInputFormat();
InputSplit[] splits = input.getSplits(job, job.getNumMapTasks());
log.debug("Nb splits : {}", splits.length);
InputSplit[] sorted = Arrays.copyOf(splits, splits.length);
Builder.sortSplits(sorted);
int numTrees = Builder.getNbTrees(job); // total number of trees
firstOutput = new PartialOutputCollector(numTrees);
Reporter reporter = Reporter.NULL;
firstIds = new int[splits.length];
sizes = new int[splits.length];
// to compute firstIds, process the splits in file order
int firstId = 0;
long slowest = 0; // duration of slowest map
for (InputSplit split : splits) {
int hp = ArrayUtils.indexOf(sorted, split); // hadoop's partition
RecordReader<LongWritable, Text> reader = input.getRecordReader(split, job, reporter);
LongWritable key = reader.createKey();
Text value = reader.createValue();
Step1Mapper mapper = new MockStep1Mapper(getTreeBuilder(), dataset, getSeed(),