// We are making the pre-warm and held containers to be the same and using the helper API to
// set up pre-warming. They can be made different and also custom initialization logic can be
// specified using other API's. We know that the OrderedWordCount dag uses default files and
// resources. Otherwise we would have to specify matching parameters in the preWarm API too.
tezConf.setInt(TezConfiguration.TEZ_AM_SESSION_MIN_HELD_CONTAINERS, numPartitions);
tezClient.preWarm(PreWarmVertex.createConfigBuilder(tezConf).build());
}
// the remaining code is the same as submitting any DAG.
try {
for (int i=0; i<inputPaths.length; ++i) {