Example usage for org.apache.hadoop.mapreduce MRJobConfig ID

List of usage examples for org.apache.hadoop.mapreduce MRJobConfig ID

Introduction

In this page you can find the example usage for org.apache.hadoop.mapreduce MRJobConfig ID.

Prototype

String ID

To view the source code for org.apache.hadoop.mapreduce MRJobConfig ID.

Click Source Link

Usage

From source file:org.apache.beam.sdk.io.hadoop.format.HadoopFormatIOTest.java

License:Apache License

private static Configuration loadTestConfiguration(Class<?> outputFormatClassName, Class<?> keyClass,
        Class<?> valueClass) {
    Configuration conf = new Configuration();
    conf.setClass(MRJobConfig.OUTPUT_FORMAT_CLASS_ATTR, outputFormatClassName, OutputFormat.class);
    conf.setClass(MRJobConfig.OUTPUT_KEY_CLASS, keyClass, Object.class);
    conf.setClass(MRJobConfig.OUTPUT_VALUE_CLASS, valueClass, Object.class);
    conf.setInt(MRJobConfig.NUM_REDUCES, REDUCERS_COUNT);
    conf.set(MRJobConfig.ID, String.valueOf(1));
    return conf;//from  w w  w .j a  v a 2  s.  com
}

From source file:org.apache.beam.sdk.io.hadoop.format.HadoopFormats.java

License:Apache License

/**
 * Creates {@link JobID} with {@code jtIdentifier} specified in hadoop {@link Configuration} under
 * {@link MRJobConfig#ID} key.//from w w w .j av  a  2 s. com
 *
 * @param conf hadoop {@link Configuration}
 * @return JobID created from {@link Configuration}
 */
static JobID getJobId(Configuration conf) {
    String jobJtIdentifier = Preconditions.checkNotNull(conf.get(MRJobConfig.ID),
            "Configuration must contain jobID under key \"%s\".", HadoopFormatIO.JOB_ID);

    return new JobID(jobJtIdentifier, DEFAULT_JOB_NUMBER);
}

From source file:org.apache.ignite.internal.processors.hadoop.impl.v2.HadoopV2Context.java

License:Apache License

/**
 * @param ctx Context for IO operations.
 *//*ww  w  .ja v a  2 s  . co m*/
public HadoopV2Context(HadoopV2TaskContext ctx) {
    super(ctx.jobConf(), ctx.jobContext().getJobID());

    taskAttemptID = ctx.attemptId();

    conf.set(MRJobConfig.ID, taskAttemptID.getJobID().toString());
    conf.set(MRJobConfig.TASK_ID, taskAttemptID.getTaskID().toString());
    conf.set(MRJobConfig.TASK_ATTEMPT_ID, taskAttemptID.toString());

    output = ctx.output();
    input = ctx.input();

    this.ctx = ctx;
}