Example usage for org.apache.hadoop.mapred JobConf getInt

List of usage examples for org.apache.hadoop.mapred JobConf getInt

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred JobConf getInt.

Prototype

public int getInt(String name, int defaultValue) 

Source Link

Document

Get the value of the name property as an int.

Usage

From source file:voldemort.store.readwrite.mr.HadoopRWStoreBuilderReducer.java

License:Apache License

@Override
public void configure(JobConf job) {
    super.configure(job);

    this.totalBytes = 0;
    this.chunkId = job.getInt("mapred.task.partition", -1); // http://www.mail-archive.com/core-user@hadoop.apache.org/msg05749.html

    if (this.chunkId < 0) {
        throw new RuntimeException("Incorrect chunk id ");
    }//from   w  ww  .j a va 2s  .c  om
    this.nodeId = this.chunkId / getNumChunks();

    this.client = new AdminClient(getCluster(), new AdminClientConfig());
    logger.info("Reducer for Node id - " + this.nodeId + " and chunk id - " + this.chunkId);
}