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

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

Introduction

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

Prototype

String TASK_PARTITION

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

Click Source Link

Usage

From source file:com.cloudera.oryx.computation.common.fn.OryxReduceDoFn.java

License:Open Source License

@Override
public void initialize() {
    super.initialize();
    this.configuration = OryxConfiguration.get(getContext().getConfiguration());

    ConfigUtils.overlayConfigOnDefault(configuration.get(JobStep.CONFIG_SERIALIZATION_KEY));

    numPartitions = getContext().getNumReduceTasks();
    partition = configuration.getInt(MRJobConfig.TASK_PARTITION, -1);
    log.info("Partition index {} ({} total)", partition, numPartitions);
    Preconditions.checkArgument(numPartitions > 0, "# partitions must be positive: %s", numPartitions);
    Preconditions.checkArgument(partition >= 0 && partition < numPartitions,
            "Partitions must be in [0,# partitions): %s", partition);
}