Search in sources :

Example 1 with DistributedProgramRunnableModule

use of co.cask.cdap.app.guice.DistributedProgramRunnableModule 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));
}
Also used : MapReduceContextConfig(co.cask.cdap.internal.app.runtime.batch.MapReduceContextConfig) SystemArguments(co.cask.cdap.internal.app.runtime.SystemArguments) Arguments(co.cask.cdap.app.runtime.Arguments) DistributedProgramRunnableModule(co.cask.cdap.app.guice.DistributedProgramRunnableModule)

Aggregations

DistributedProgramRunnableModule (co.cask.cdap.app.guice.DistributedProgramRunnableModule)1 Arguments (co.cask.cdap.app.runtime.Arguments)1 SystemArguments (co.cask.cdap.internal.app.runtime.SystemArguments)1 MapReduceContextConfig (co.cask.cdap.internal.app.runtime.batch.MapReduceContextConfig)1