Package co.cask.cdap.api.mapreduce

Examples of co.cask.cdap.api.mapreduce.MapReduce


                                ? 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());
View Full Code Here

TOP

Related Classes of co.cask.cdap.api.mapreduce.MapReduce

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.