Examples of YarnConfiguration


Examples of org.apache.hadoop.yarn.conf.YarnConfiguration

  }

  @Test
  public void testZKRetryInterval() throws Exception {
    TestZKClient zkClientTester = new TestZKClient();
    YarnConfiguration conf = new YarnConfiguration();

    ZKRMStateStore store =
        (ZKRMStateStore) zkClientTester.getRMStateStore(conf);
    assertEquals(YarnConfiguration.DEFAULT_RM_ZK_RETRY_INTERVAL_MS,
        store.zkRetryInterval);
    store.stop();

    conf.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
    store =
        (ZKRMStateStore) zkClientTester.getRMStateStore(conf);
    assertEquals(YarnConfiguration.DEFAULT_RM_ZK_TIMEOUT_MS /
            YarnConfiguration.DEFAULT_ZK_RM_NUM_RETRIES,
        store.zkRetryInterval);
View Full Code Here

Examples of org.apache.hadoop.yarn.conf.YarnConfiguration

    testAppDeletion(zkTester);
  }

  private Configuration createHARMConf(
      String rmIds, String rmId, int adminPort) {
    Configuration conf = new YarnConfiguration();
    conf.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
    conf.set(YarnConfiguration.RM_HA_IDS, rmIds);
    conf.setBoolean(YarnConfiguration.RECOVERY_ENABLED, true);
    conf.set(YarnConfiguration.RM_STORE, ZKRMStateStore.class.getName());
    conf.set(YarnConfiguration.RM_ZK_ADDRESS, hostPort);
    conf.setInt(YarnConfiguration.RM_ZK_TIMEOUT_MS, ZK_TIMEOUT_MS);
    conf.set(YarnConfiguration.RM_HA_ID, rmId);
    conf.set(YarnConfiguration.RM_WEBAPP_ADDRESS, "localhost:0");

    for (String rpcAddress : YarnConfiguration.getServiceAddressConfKeys(conf)) {
      for (String id : HAUtil.getRMHAIds(conf)) {
        conf.set(HAUtil.addSuffix(rpcAddress, id), "localhost:0");
      }
    }
    conf.set(HAUtil.addSuffix(YarnConfiguration.RM_ADMIN_ADDRESS, rmId),
        "localhost:" + adminPort);
    return conf;
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.conf.YarnConfiguration

            + appId;
      }
    }

    public RMStateStore getRMStateStore() throws Exception {
      YarnConfiguration conf = new YarnConfiguration();
      workingZnode = "/Test";
      conf.set(YarnConfiguration.RM_ZK_ADDRESS, hostPort);
      conf.set(YarnConfiguration.ZK_RM_STATE_STORE_PARENT_PATH, workingZnode);
      this.client = createClient();
      this.store = new TestZKRMStateStoreInternal(conf, workingZnode);
      return this.store;
    }
View Full Code Here

Examples of org.apache.hadoop.yarn.conf.YarnConfiguration

  @Test (timeout = 30000)
  public void testAppOnMultiNode() throws Exception {
    Logger rootLogger = LogManager.getRootLogger();
    rootLogger.setLevel(Level.DEBUG);
    YarnConfiguration conf = new YarnConfiguration();
    conf.set("yarn.scheduler.capacity.node-locality-delay", "-1");
    MockRM rm = new MockRM(conf);
    rm.start();
    MockNM nm1 = rm.registerNode("h1:1234", 5120);
    MockNM nm2 = rm.registerNode("h2:5678", 10240);
   
View Full Code Here

Examples of org.apache.hadoop.yarn.conf.YarnConfiguration

  // Test even if AM container is allocated with containerId not equal to 1, the
  // following allocate requests from AM should be able to retrieve the
  // corresponding NM Token.
  @Test (timeout = 20000)
  public void testNMTokenSentForNormalContainer() throws Exception {
    YarnConfiguration conf = new YarnConfiguration();
    conf.set(YarnConfiguration.RM_SCHEDULER,
        CapacityScheduler.class.getCanonicalName());
    MockRM rm = new MockRM(conf);
    rm.start();
    MockNM nm1 = rm.registerNode("h1:1234", 5120);
    RMApp app = rm.submitApp(2000);
View Full Code Here

Examples of org.apache.hadoop.yarn.conf.YarnConfiguration

    }
  }

  @Test (timeout = 300000)
  public void testActivatingApplicationAfterAddingNM() throws Exception {
    YarnConfiguration conf = new YarnConfiguration();

    MockRM rm1 = new MockRM(conf);

    // start like normal because state is empty
    rm1.start();
View Full Code Here

Examples of org.apache.hadoop.yarn.conf.YarnConfiguration

  // This is to test AM Host and rpc port are invalidated after the am attempt
  // is killed or failed, so that client doesn't get the wrong information.
  @Test (timeout = 80000)
  public void testInvalidateAMHostPortWhenAMFailedOrKilled() throws Exception {
    YarnConfiguration conf = new YarnConfiguration();
    conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS, 1);
    MockRM rm1 = new MockRM(conf);
    rm1.start();

    // a succeeded app
    RMApp app1 = rm1.submitApp(200);
View Full Code Here

Examples of org.apache.hadoop.yarn.conf.YarnConfiguration

    }
  }

  @Test (timeout = 60000)
  public void testInvalidatedAMHostPortOnAMRestart() throws Exception {
    YarnConfiguration conf = new YarnConfiguration();
    MockRM rm1 = new MockRM(conf);
    rm1.start();
    MockNM nm1 =
        new MockNM("127.0.0.1:1234", 15120, rm1.getResourceTrackerService());
    nm1.registerNode();
View Full Code Here

Examples of org.apache.hadoop.yarn.conf.YarnConfiguration

   * @throws Exception exception
   */
  @Test (timeout = 60000)
  public void testApplicationKillAtAcceptedState() throws Exception {

    YarnConfiguration conf = new YarnConfiguration();
    final Dispatcher dispatcher = new AsyncDispatcher() {
      @Override
      public EventHandler getEventHandler() {

        class EventArgMatcher extends ArgumentMatcher<AbstractEvent> {
View Full Code Here

Examples of org.apache.hadoop.yarn.conf.YarnConfiguration

    EventHandler<RMAppAttemptEvent> appAttemptEventHandler = mock(EventHandler.class);
    EventHandler generic = mock(EventHandler.class);
    drainDispatcher.register(RMAppAttemptEventType.class,
        appAttemptEventHandler);
    drainDispatcher.register(RMNodeEventType.class, generic);
    drainDispatcher.init(new YarnConfiguration());
    drainDispatcher.start();
    NodeId nodeId = BuilderUtils.newNodeId("host", 3425);
    ApplicationId appId = BuilderUtils.newApplicationId(1, 1);
    ApplicationAttemptId appAttemptId = BuilderUtils.newApplicationAttemptId(
        appId, 1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.