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

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

Introduction

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

Prototype

String RM_NM_HEARTBEAT_INTERVAL_MS

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

Click Source Link

Document

RM set next Heartbeat interval for NM

Usage

From source file:com.splicemachine.test.SpliceTestYarnPlatform.java

License:Apache License

private void configForTesting() throws URISyntaxException {
    yarnSiteConfigURL = Thread.currentThread().getContextClassLoader().getResource("yarn-site.xml");
    if (yarnSiteConfigURL == null) {
        throw new RuntimeException("Could not find 'yarn-site.xml' file in classpath");
    } else {/*from  w  w  w  . j  a  v a2 s  . c  o  m*/
        LOG.info("Found 'yarn-site.xml' at " + yarnSiteConfigURL.toURI().toString());
    }

    conf = new YarnConfiguration();
    conf.set(FileSystem.FS_DEFAULT_NAME_KEY, "file:///");
    conf.setDouble("yarn.nodemanager.resource.io-spindles", 2.0);
    conf.set("fs.default.name", "file:///");
    conf.set("yarn.nodemanager.container-executor.class",
            "org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor");
    System.setProperty("zookeeper.sasl.client", "false");
    System.setProperty("zookeeper.sasl.serverconfig", "fake");

    conf.setInt(YarnConfiguration.RM_NM_HEARTBEAT_INTERVAL_MS, DEFAULT_HEARTBEAT_INTERVAL);
    conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 128);
    conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class, ResourceScheduler.class);
    conf.set("yarn.application.classpath", new File(yarnSiteConfigURL.getPath()).getParent());
}

From source file:io.hops.ha.common.TestDBLimites.java

License:Apache License

@Before
public void setup() throws IOException {
    try {//  w  w w  .j av  a2 s  . c  o m
        LOG.info("Setting up Factories");
        Configuration conf = new YarnConfiguration();
        conf.set(YarnConfiguration.RM_NM_HEARTBEAT_INTERVAL_MS, "4000");
        YarnAPIStorageFactory.setConfiguration(conf);
        RMStorageFactory.setConfiguration(conf);
        RMStorageFactory.getConnector().formatStorage();
    } catch (StorageInitializtionException ex) {
        LOG.error(ex);
    } catch (StorageException ex) {
        LOG.error(ex);
    }
}

From source file:io.hops.metadata.util.TestFairSchedulerUtilities.java

License:Apache License

@Before
public void setup() throws IOException {
    try {//  w  w w .ja  v a  2 s  . c om
        LOG.info("Setting up Factories");
        conf = new YarnConfiguration();
        conf.set(YarnConfiguration.RM_NM_HEARTBEAT_INTERVAL_MS, "4000");
        YarnAPIStorageFactory.setConfiguration(conf);
        RMStorageFactory.setConfiguration(conf);
        RMStorageFactory.getConnector().formatStorage();
        conf.setClass(YarnConfiguration.RM_SCHEDULER, FairScheduler.class, ResourceScheduler.class);
        // All tests assume only one assignment per node update
    } catch (StorageInitializtionException ex) {
        LOG.error(ex);
    } catch (StorageException ex) {
        LOG.error(ex);
    }
}

From source file:io.hops.metadata.util.TestHopYarnAPIUtilities.java

License:Apache License

@Before
public void setup() throws StorageInitializtionException, StorageException, IOException {
    LOG.info("Setting up Factories");
    conf = new YarnConfiguration();
    conf.set(YarnConfiguration.RM_NM_HEARTBEAT_INTERVAL_MS, "4000");
    YarnAPIStorageFactory.setConfiguration(conf);
    RMStorageFactory.setConfiguration(conf);
    RMUtilities.InitializeDB();/* w w  w.  j  ava  2s .  c  om*/
    conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class, ResourceScheduler.class);
}

From source file:org.apache.gobblin.yarn.YarnServiceTest.java

License:Apache License

@BeforeClass
public void setUp() throws Exception {
    // Set java home in environment since it isn't set on some systems
    String javaHome = System.getProperty("java.home");
    setEnv("JAVA_HOME", javaHome);

    this.clusterConf = new YarnConfiguration();
    this.clusterConf.set(YarnConfiguration.RM_NM_HEARTBEAT_INTERVAL_MS, "100");
    this.clusterConf.set(YarnConfiguration.RESOURCEMANAGER_CONNECT_MAX_WAIT_MS, "10000");
    this.clusterConf.set(YarnConfiguration.YARN_CLIENT_APPLICATION_CLIENT_PROTOCOL_POLL_TIMEOUT_MS, "60000");

    this.yarnCluster = this.closer.register(new MiniYARNCluster("YarnServiceTestCluster", 4, 1, 1));
    this.yarnCluster.init(this.clusterConf);
    this.yarnCluster.start();

    // YARN client should not be started before the Resource Manager is up
    AssertWithBackoff.create().logger(LOG).timeoutMs(10000).assertTrue(new Predicate<Void>() {
        @Override//w  w  w. jav a 2s  .c  o  m
        public boolean apply(Void input) {
            return !clusterConf.get(YarnConfiguration.RM_ADDRESS).contains(":0");
        }
    }, "Waiting for RM");

    this.yarnClient = this.closer.register(YarnClient.createYarnClient());
    this.yarnClient.init(this.clusterConf);
    this.yarnClient.start();

    URL url = YarnServiceTest.class.getClassLoader()
            .getResource(YarnServiceTest.class.getSimpleName() + ".conf");
    Assert.assertNotNull(url, "Could not find resource " + url);

    this.config = ConfigFactory.parseURL(url).resolve();

    // Start a dummy application manager so that the YarnService can use the AM-RM token.
    startApp();

    // create and start the test yarn service
    this.yarnService = new TestYarnService(this.config, "testApp", "appId", this.clusterConf,
            FileSystem.getLocal(new Configuration()), this.eventBus);

    this.yarnService.startUp();
}

From source file:org.apache.tez.analyzer.TestAnalyzer.java

License:Apache License

private static void setupTezCluster() throws Exception {
    // make the test run faster by speeding heartbeat frequency
    conf.setInt(YarnConfiguration.RM_NM_HEARTBEAT_INTERVAL_MS, 100);
    conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
    conf.setBoolean(TezConfiguration.TEZ_AM_ALLOW_DISABLED_TIMELINE_DOMAINS, true);
    conf.set(TezConfiguration.TEZ_HISTORY_LOGGING_SERVICE_CLASS, ATSHistoryLoggingService.class.getName());

    miniTezCluster = new MiniTezClusterWithTimeline(TestAnalyzer.class.getName(), 1, 1, 1, true);

    miniTezCluster.init(conf);/*  w w w. j  a va  2  s .co  m*/
    miniTezCluster.start();
    yarnTimelineAddress = miniTezCluster.getConfig().get(YarnConfiguration.TIMELINE_SERVICE_WEBAPP_ADDRESS);
}