use of co.cask.cdap.internal.app.runtime.batch.MapReduceContextConfig in project cdap by caskdata.
the class DistributedMapReduceTaskContextProvider method createInjector.
private static Injector createInjector(CConfiguration cConf, Configuration hConf) {
MapReduceContextConfig mapReduceContextConfig = new MapReduceContextConfig(hConf);
// principal will be null if running on a kerberos distributed cluster
Arguments arguments = mapReduceContextConfig.getProgramOptions().getArguments();
String principal = arguments.getOption(ProgramOptionConstants.PRINCIPAL);
String runId = arguments.getOption(ProgramOptionConstants.RUN_ID);
String instanceId = arguments.getOption(ProgramOptionConstants.INSTANCE_ID);
return Guice.createInjector(new DistributedProgramRunnableModule(cConf, hConf).createModule(mapReduceContextConfig.getProgramId(), runId, instanceId, principal));
}
Aggregations