Package org.apache.hadoop.yarn.api.records

Examples of org.apache.hadoop.yarn.api.records.ApplicationId


  }

  @Test
  public void testReadWriteApplicationHistory() throws Exception {
    // Out of order
    ApplicationId appId = ApplicationId.newInstance(0, 1);
    try {
      writeApplicationFinishData(appId);
      Assert.fail();
    } catch (IOException e) {
      Assert.assertTrue(e.getMessage().contains(
        "is stored before the start information"));
    }
    // Normal
    int numApps = 5;
    for (int i = 1; i <= numApps; ++i) {
      appId = ApplicationId.newInstance(0, i);
      writeApplicationStartData(appId);
      writeApplicationFinishData(appId);
    }
    Assert.assertEquals(numApps, store.getAllApplications().size());
    for (int i = 1; i <= numApps; ++i) {
      appId = ApplicationId.newInstance(0, i);
      ApplicationHistoryData data = store.getApplication(appId);
      Assert.assertNotNull(data);
      Assert.assertEquals(appId.toString(), data.getApplicationName());
      Assert.assertEquals(appId.toString(), data.getDiagnosticsInfo());
    }
    // Write again
    appId = ApplicationId.newInstance(0, 1);
    try {
      writeApplicationStartData(appId);
View Full Code Here


  }

  @Test
  public void testReadWriteApplicationAttemptHistory() throws Exception {
    // Out of order
    ApplicationId appId = ApplicationId.newInstance(0, 1);
    ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(appId, 1);
    try {
      writeApplicationAttemptFinishData(appAttemptId);
      Assert.fail();
View Full Code Here

  }

  @Test
  public void testReadWriteContainerHistory() throws Exception {
    // Out of order
    ApplicationId appId = ApplicationId.newInstance(0, 1);
    ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(appId, 1);
    ContainerId containerId = ContainerId.newInstance(appAttemptId, 1);
    try {
      writeContainerFinishData(containerId);
View Full Code Here

  public void testMassiveWriteContainerHistory() throws IOException {
    long mb = 1024 * 1024;
    Runtime runtime = Runtime.getRuntime();
    long usedMemoryBefore = (runtime.totalMemory() - runtime.freeMemory()) / mb;
    int numContainers = 100000;
    ApplicationId appId = ApplicationId.newInstance(0, 1);
    ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(appId, 1);
    for (int i = 1; i <= numContainers; ++i) {
      ContainerId containerId = ContainerId.newInstance(appAttemptId, i);
      writeContainerStartData(containerId);
View Full Code Here

  private void testWriteHistoryData(
      int num, boolean missingContainer, boolean missingApplicationAttempt)
          throws IOException {
    // write application history data
    for (int i = 1; i <= num; ++i) {
      ApplicationId appId = ApplicationId.newInstance(0, i);
      writeApplicationStartData(appId);

      // write application attempt history data
      for (int j = 1; j <= num; ++j) {
        ApplicationAttemptId appAttemptId =
View Full Code Here

      int num, boolean missingContainer, boolean missingApplicationAttempt)
          throws IOException {
    // read application history data
    Assert.assertEquals(num, store.getAllApplications().size());
    for (int i = 1; i <= num; ++i) {
      ApplicationId appId = ApplicationId.newInstance(0, i);
      ApplicationHistoryData appData = store.getApplication(appId);
      Assert.assertNotNull(appData);
      Assert.assertEquals(appId.toString(), appData.getApplicationName());
      Assert.assertEquals(appId.toString(), appData.getDiagnosticsInfo());

      // read application attempt history data
      Assert.assertEquals(num, store.getApplicationAttempts(appId).size());
      for (int j = 1; j <= num; ++j) {
        ApplicationAttemptId appAttemptId =
View Full Code Here

  }

  @Test
  public void testWriteAfterApplicationFinish() throws IOException {
    LOG.info("Starting testWriteAfterApplicationFinish");
    ApplicationId appId = ApplicationId.newInstance(0, 1);
    writeApplicationStartData(appId);
    writeApplicationFinishData(appId);
    // write application attempt history data
    ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(appId, 1);
View Full Code Here

  @Test
  public void testMassiveWriteContainerHistoryData() throws IOException {
    LOG.info("Starting testMassiveWriteContainerHistoryData");
    long mb = 1024 * 1024;
    long usedDiskBefore = fs.getContentSummary(fsWorkingPath).getLength() / mb;
    ApplicationId appId = ApplicationId.newInstance(0, 1);
    writeApplicationStartData(appId);
    ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(appId, 1);
    for (int i = 1; i <= 100000; ++i) {
      ContainerId containerId = ContainerId.newInstance(appAttemptId, i);
View Full Code Here

        yarnClient,
        clusterSecure,
        sliderAMResourceComponent,
        applicationTags);

    ApplicationId appId = amLauncher.getApplicationId();
    // set the application name;
    amLauncher.setKeepContainersOverRestarts(true);

    amLauncher.setMaxAppAttempts(config.getInt(KEY_AM_RESTART_LIMIT,
                                               DEFAULT_AM_RESTART_LIMIT));

    sliderFileSystem.purgeAppInstanceTempFiles(clustername);
    Path tempPath = sliderFileSystem.createAppInstanceTempPath(
        clustername,
        appId.toString() + "/am");
    String libdir = "lib";
    Path libPath = new Path(tempPath, libdir);
    sliderFileSystem.getFileSystem().mkdirs(libPath);
    log.debug("FS={}, tempPath={}, libdir={}", sliderFileSystem.toString(),
              tempPath, libPath);
View Full Code Here

      SliderUtils.mandatoryEnvVariable(
          ApplicationConstants.Environment.CONTAINER_ID.name())
                                                       );
    appAttemptID = appMasterContainerID.getApplicationAttemptId();

    ApplicationId appid = appAttemptID.getApplicationId();
    log.info("AM for ID {}", appid.getId());

    appInformation.put(StatusKeys.INFO_AM_CONTAINER_ID,
                       appMasterContainerID.toString());
    appInformation.put(StatusKeys.INFO_AM_APP_ID,
                       appid.toString());
    appInformation.put(StatusKeys.INFO_AM_ATTEMPT_ID,
                       appAttemptID.toString());

    UserGroupInformation currentUser = UserGroupInformation.getCurrentUser();
    Credentials credentials =
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.api.records.ApplicationId

Copyright © 2018 www.massapicom. 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.