Example usage for org.apache.hadoop.yarn.conf YarnConfiguration NM_CONTAINER_MGR_THREAD_COUNT

List of usage examples for org.apache.hadoop.yarn.conf YarnConfiguration NM_CONTAINER_MGR_THREAD_COUNT

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.conf YarnConfiguration NM_CONTAINER_MGR_THREAD_COUNT.

Prototype

String NM_CONTAINER_MGR_THREAD_COUNT

To view the source code for org.apache.hadoop.yarn.conf YarnConfiguration NM_CONTAINER_MGR_THREAD_COUNT.

Click Source Link

Document

Number of threads container manager uses.

Usage

From source file:org.apache.tez.auxservices.TestShuffleHandlerJobs.java

License:Apache License

@BeforeClass
public static void setup() throws IOException {
    try {/*from w  w  w  . j a  v a  2s  .  c om*/
        conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS, 1);
        conf.setInt(YarnConfiguration.NM_CONTAINER_MGR_THREAD_COUNT, 22);
        dfsCluster = new MiniDFSCluster.Builder(conf).numDataNodes(NUM_DNS).format(true).build();
        remoteFs = dfsCluster.getFileSystem();
    } catch (IOException io) {
        throw new RuntimeException("problem starting mini dfs cluster", io);
    }

    if (!(new File(MiniTezCluster.APPJAR)).exists()) {
        LOG.info("MRAppJar " + MiniTezCluster.APPJAR + " not found. Not running test.");
        return;
    }

    if (tezCluster == null) {
        tezCluster = new MiniTezCluster(TestShuffleHandlerJobs.class.getName(), NUM_NMS, 1, 1);
        Configuration conf = new Configuration();
        conf.set(YarnConfiguration.NM_AUX_SERVICES, ShuffleHandler.TEZ_SHUFFLE_SERVICEID);
        String serviceStr = String.format(YarnConfiguration.NM_AUX_SERVICE_FMT,
                ShuffleHandler.TEZ_SHUFFLE_SERVICEID);
        conf.set(serviceStr, ShuffleHandler.class.getName());
        conf.setInt(ShuffleHandler.SHUFFLE_PORT_CONFIG_KEY, 0);
        conf.set("fs.defaultFS", remoteFs.getUri().toString()); // use HDFS
        conf.setLong(YarnConfiguration.DEBUG_NM_DELETE_DELAY_SEC, 0l);
        tezCluster.init(conf);
        tezCluster.start();
    }

}