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

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

Introduction

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

Prototype

int DEFAULT_MAP_MEMORY_MB

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

Click Source Link

Usage

From source file:org.apache.tez.mapreduce.hadoop.TestMRHelpers.java

License:Apache License

@Test(timeout = 5000)
public void testContainerResourceConstruction() {
    JobConf conf = new JobConf(new Configuration());
    Resource mapResource = MRHelpers.getResourceForMRMapper(conf);
    Resource reduceResource = MRHelpers.getResourceForMRReducer(conf);

    Assert.assertEquals(MRJobConfig.DEFAULT_MAP_CPU_VCORES, mapResource.getVirtualCores());
    Assert.assertEquals(MRJobConfig.DEFAULT_MAP_MEMORY_MB, mapResource.getMemory());
    Assert.assertEquals(MRJobConfig.DEFAULT_REDUCE_CPU_VCORES, reduceResource.getVirtualCores());
    Assert.assertEquals(MRJobConfig.DEFAULT_REDUCE_MEMORY_MB, reduceResource.getMemory());

    conf.setInt(MRJobConfig.MAP_CPU_VCORES, 2);
    conf.setInt(MRJobConfig.MAP_MEMORY_MB, 123);
    conf.setInt(MRJobConfig.REDUCE_CPU_VCORES, 20);
    conf.setInt(MRJobConfig.REDUCE_MEMORY_MB, 1234);

    mapResource = MRHelpers.getResourceForMRMapper(conf);
    reduceResource = MRHelpers.getResourceForMRReducer(conf);

    Assert.assertEquals(2, mapResource.getVirtualCores());
    Assert.assertEquals(123, mapResource.getMemory());
    Assert.assertEquals(20, reduceResource.getVirtualCores());
    Assert.assertEquals(1234, reduceResource.getMemory());
}