? Long.parseLong(arguments
.getOption(ProgramOptionConstants.LOGICAL_START_TIME))
: System.currentTimeMillis();
String workflowBatch = arguments.getOption(ProgramOptionConstants.WORKFLOW_BATCH);
MapReduce mapReduce;
try {
mapReduce = new InstantiatorFactory(false).get(TypeToken.of(program.<MapReduce>getMainClass())).create();
} catch (Exception e) {
LOG.error("Failed to instantiate MapReduce class for {}", spec.getClassName(), e);
throw Throwables.propagate(e);
}
final BasicMapReduceContext context =
new BasicMapReduceContext(program, null, runId, options.getUserArguments(),
program.getSpecification().getDatasets().keySet(), spec,
logicalStartTime,
workflowBatch, discoveryServiceClient, metricsCollectionService,
datasetFramework, cConf);
Reflections.visit(mapReduce, TypeToken.of(mapReduce.getClass()),
new PropertyFieldSetter(context.getSpecification().getProperties()),
new DataSetFieldSetter(context));
// note: this sets logging context on the thread level
LoggingContextAccessor.setLoggingContext(context.getLoggingContext());