protected void secondStep(Configuration conf, Path forestPath, PredictionCallback callback)
throws IOException, InterruptedException {
JobContext jobContext = new JobContext(conf, new JobID());
// retrieve the splits
TextInputFormat input = new TextInputFormat();
List<InputSplit> splits = input.getSplits(jobContext);
int nbSplits = splits.size();
log.debug("Nb splits : {}", nbSplits);
InputSplit[] sorted = new InputSplit[nbSplits];
splits.toArray(sorted);
Builder.sortSplits(sorted);
int numTrees = Builder.getNbTrees(conf); // total number of trees
// compute the expected number of outputs
int total = 0;
for (int p = 0; p < nbSplits; p++) {
total += Step2Mapper.nbConcerned(nbSplits, numTrees, p);
}
TaskAttemptContext task = new TaskAttemptContext(conf, new TaskAttemptID());
secondOutput = new MockContext(new Step2Mapper(), conf, task.getTaskAttemptID(), numTrees);
long slowest = 0; // duration of slowest map
for (int partition = 0; partition < nbSplits; partition++) {
InputSplit split = sorted[partition];
RecordReader<LongWritable, Text> reader = input.createRecordReader(split, task);
// load the output of the 1st step
int nbConcerned = Step2Mapper.nbConcerned(nbSplits, numTrees, partition);
TreeID[] fsKeys = new TreeID[nbConcerned];
Node[] fsTrees = new Node[nbConcerned];