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

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


    ApplicationId applicationId = ApplicationId.newInstance(1234, 5);
    ApplicationAttemptId attemptId = ApplicationAttemptId.newInstance(
        applicationId, 1);
    ContainerId containerId = ContainerId.newInstance(attemptId, 1);
    ContainerId containerId1 = ContainerId.newInstance(attemptId, 2);
    ContainerReport container = ContainerReport.newInstance(containerId, null,
        NodeId.newInstance("host", 1234), Priority.UNDEFINED, 1234, 5678,
        "diagnosticInfo", "logURL", 0, ContainerState.COMPLETE);
    ContainerReport container1 = ContainerReport.newInstance(containerId1, null,
        NodeId.newInstance("host", 1234), Priority.UNDEFINED, 1234, 5678,
        "diagnosticInfo", "logURL", 0, ContainerState.COMPLETE);
    List<ContainerReport> reports = new ArrayList<ContainerReport>();
    reports.add(container);
    reports.add(container1);
View Full Code Here


    ApplicationId applicationId = ApplicationId.newInstance(1234, 5);
    ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(
        applicationId, 1);
    ContainerId containerId = ContainerId.newInstance(appAttemptId, 1);
    ContainerReport report = client.getContainerReport(containerId);
    Assert.assertNotNull(report);
    Assert.assertEquals(report.getContainerId().toString(),
        (ContainerId.newInstance(expectedReports.get(0)
            .getCurrentApplicationAttemptId(), 1)).toString());
    client.stop();
  }
View Full Code Here

              newApplicationReport.getCurrentApplicationAttemptId(), 2));
      appAttempts.add(attempt1);
      attempts.put(applicationId, appAttempts);

      List<ContainerReport> containerReports = new ArrayList<ContainerReport>();
      ContainerReport container = ContainerReport.newInstance(
          ContainerId.newInstance(attempt.getApplicationAttemptId(), 1), null,
          NodeId.newInstance("host", 1234), Priority.UNDEFINED, 1234, 5678,
          "diagnosticInfo", "logURL", 0, ContainerState.COMPLETE);
      containerReports.add(container);

      ContainerReport container1 = ContainerReport.newInstance(
          ContainerId.newInstance(attempt.getApplicationAttemptId(), 2), null,
          NodeId.newInstance("host", 1234), Priority.UNDEFINED, 1234, 5678,
          "diagnosticInfo", "logURL", 0, ContainerState.COMPLETE);
      containerReports.add(container1);
      containers.put(attempt.getApplicationAttemptId(), containerReports);
View Full Code Here

              newApplicationReport.getCurrentApplicationAttemptId(), 2));
      appAttempts.add(attempt1);
      attempts.put(applicationId, appAttempts);

      List<ContainerReport> containerReports = new ArrayList<ContainerReport>();
      ContainerReport container =
          ContainerReport.newInstance(
            ContainerId.newInstance(attempt.getApplicationAttemptId(), 1),
            null, NodeId.newInstance("host", 1234), Priority.UNDEFINED, 1234,
            5678, "diagnosticInfo", "logURL", 0, ContainerState.COMPLETE);
      containerReports.add(container);

      ContainerReport container1 =
          ContainerReport.newInstance(
            ContainerId.newInstance(attempt.getApplicationAttemptId(), 2),
            null, NodeId.newInstance("host", 1234), Priority.UNDEFINED, 1234,
            5678, "diagnosticInfo", "logURL", 0, ContainerState.COMPLETE);
      containerReports.add(container1);
View Full Code Here

        reports);
  }

  @Test(timeout = 15000)
  public void testGetContainerReportOnHA() throws Exception {
    ContainerReport report =
        client.getContainerReport(cluster.createFakeContainerId());
    Assert.assertTrue(report != null);
    Assert.assertEquals(cluster.createFakeContainerReport(), report);
  }
View Full Code Here

    ApplicationId applicationId = ApplicationId.newInstance(1234, 5);
    ApplicationAttemptId appAttemptId =
        ApplicationAttemptId.newInstance(applicationId, 1);
    ContainerId containerId = ContainerId.newInstance(appAttemptId, 1);
    ContainerReport report = client.getContainerReport(containerId);
    Assert.assertNotNull(report);
    Assert.assertEquals(report.getContainerId().toString(), (ContainerId
      .newInstance(expectedReports.get(0).getCurrentApplicationAttemptId(), 1))
      .toString());
    client.stop();
  }
View Full Code Here

    GetContainerReportRequest request =
        GetContainerReportRequest.newInstance(containerId);
    GetContainerReportResponse response =
        historyServer.getClientService().getClientHandler()
          .getContainerReport(request);
    ContainerReport container = response.getContainerReport();
    Assert.assertNotNull(container);
    Assert.assertEquals(containerId, container.getContainerId());
    Assert.assertEquals(expectedLogUrl, container.getLogUrl());
  }
View Full Code Here

      String containerId) {
    ApplicationId aid = parseApplicationId(appId);
    ApplicationAttemptId aaid = parseApplicationAttemptId(appAttemptId);
    ContainerId cid = parseContainerId(containerId);
    validateIds(aid, aaid, cid);
    ContainerReport container = null;
    try {
      container = appContext.getContainer(cid);
    } catch (IOException e) {
      throw new WebApplicationException(e);
    }
View Full Code Here

    } catch (IllegalArgumentException e) {
      puts("Invalid container ID: " + containerid);
      return;
    }

    ContainerReport containerReport;
    try {
      containerReport = appContext.getContainer(containerId);
    } catch (IOException e) {
      String message = "Failed to read the container " + containerid + ".";
      LOG.error(message, e);
View Full Code Here

          ._()._().tbody();

    StringBuilder attemptsTableData = new StringBuilder("[\n");
    for (ApplicationAttemptReport appAttemptReport : attempts) {
      AppAttemptInfo appAttempt = new AppAttemptInfo(appAttemptReport);
      ContainerReport containerReport;
      try {
        containerReport =
            appContext.getAMContainer(appAttemptReport
              .getApplicationAttemptId());
      } catch (IOException e) {
        String message =
            "Failed to read the AM container of the application attempt "
                + appAttemptReport.getApplicationAttemptId() + ".";
        LOG.error(message, e);
        html.p()._(message)._();
        return;
      }
      long startTime = Long.MAX_VALUE;
      String logsLink = null;
      if (containerReport != null) {
        ContainerInfo container = new ContainerInfo(containerReport);
        startTime = container.getStartedTime();
        logsLink = containerReport.getLogUrl();
      }
      String nodeLink = null;
      if (appAttempt.getHost() != null && appAttempt.getRpcPort() >= 0
          && appAttempt.getRpcPort() < 65536) {
        nodeLink = appAttempt.getHost() + ":" + appAttempt.getRpcPort();
View Full Code Here

TOP

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

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.