Search in sources :

Example 1 with MapReduceContextConfig

use of io.cdap.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
    ProgramOptions programOptions = mapReduceContextConfig.getProgramOptions();
    Arguments systemArgs = programOptions.getArguments();
    String runId = systemArgs.getOption(ProgramOptionConstants.RUN_ID);
    return Guice.createInjector(new DistributedProgramContainerModule(cConf, hConf, mapReduceContextConfig.getProgramId().run(runId), programOptions));
}
Also used : MapReduceContextConfig(io.cdap.cdap.internal.app.runtime.batch.MapReduceContextConfig) Arguments(io.cdap.cdap.app.runtime.Arguments) SystemArguments(io.cdap.cdap.internal.app.runtime.SystemArguments) ProgramOptions(io.cdap.cdap.app.runtime.ProgramOptions) DistributedProgramContainerModule(io.cdap.cdap.app.guice.DistributedProgramContainerModule)

Aggregations

DistributedProgramContainerModule (io.cdap.cdap.app.guice.DistributedProgramContainerModule)1 Arguments (io.cdap.cdap.app.runtime.Arguments)1 ProgramOptions (io.cdap.cdap.app.runtime.ProgramOptions)1 SystemArguments (io.cdap.cdap.internal.app.runtime.SystemArguments)1 MapReduceContextConfig (io.cdap.cdap.internal.app.runtime.batch.MapReduceContextConfig)1