Examples of ApplicationReport


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

    return results;
  }

  public ApplicationReport findClusterInInstanceList(List<ApplicationReport> instances,
                                                     String appname) {
    ApplicationReport found = null;
    ApplicationReport foundAndLive = null;
    for (ApplicationReport app : instances) {
      if (app.getName().equals(appname)) {
        found = app;
        if (isApplicationLive(app)) {
          foundAndLive = app;
View Full Code Here

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

    yarnClient.submitApplication(appContext);

    // wait for app to start
    RMAppAttempt appAttempt = null;
    while (true) {
      ApplicationReport appReport = yarnClient.getApplicationReport(appId);
      if (appReport.getYarnApplicationState() == YarnApplicationState.ACCEPTED) {
        attemptId = appReport.getCurrentApplicationAttemptId();
        appAttempt =
            yarnCluster.getResourceManager().getRMContext().getRMApps()
              .get(attemptId.getApplicationId()).getCurrentAppAttempt();
        while (true) {
          if (appAttempt.getAppAttemptState() == RMAppAttemptState.LAUNCHED) {
View Full Code Here

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

          + applicationId + "' doesn't exist in RM.");
    }

    boolean allowAccess = checkAccess(callerUGI, application.getUser(),
        ApplicationAccessType.VIEW_APP, applicationId);
    ApplicationReport report =
        application.createAndGetApplicationReport(callerUGI.getUserName(),
            allowAccess);

    GetApplicationReportResponse response = recordFactory
        .newRecordInstance(GetApplicationReportResponse.class);
View Full Code Here

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

      List<ApplicationReport> apps = yarnClient.getApplications();
      if (apps.size() == 0 ) {
        Thread.sleep(10);
        continue;
      }
      ApplicationReport appReport = apps.get(0);
      if (appReport.getHost().startsWith(hostName)
          && appReport.getRpcPort() == -1) {
        verified = true;
      }
      if (appReport.getYarnApplicationState() == YarnApplicationState.FINISHED) {
        break;
      }
    }
    Assert.assertTrue(verified);
    t.join();
View Full Code Here

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

      } catch (InterruptedException e) {
        LOG.debug("Thread sleep in monitoring loop interrupted");
      }

      // Get application report for the appId we are interested in
      ApplicationReport report = yarnClient.getApplicationReport(appId);

      LOG.info("Got application report from ASM for"
          + ", appId=" + appId.getId()
          + ", clientToAMToken=" + report.getClientToAMToken()
          + ", appDiagnostics=" + report.getDiagnostics()
          + ", appMasterHost=" + report.getHost()
          + ", appQueue=" + report.getQueue()
          + ", appMasterRpcPort=" + report.getRpcPort()
          + ", appStartTime=" + report.getStartTime()
          + ", yarnAppState=" + report.getYarnApplicationState().toString()
          + ", distributedFinalState=" + report.getFinalApplicationStatus().toString()
          + ", appTrackingUrl=" + report.getTrackingUrl()
          + ", appUser=" + report.getUser());

      YarnApplicationState state = report.getYarnApplicationState();
      FinalApplicationStatus dsStatus = report.getFinalApplicationStatus();
      if (YarnApplicationState.FINISHED == state) {
        if (FinalApplicationStatus.SUCCEEDED == dsStatus) {
          LOG.info("Application has completed successfully. Breaking monitoring loop");
          return true;       
        }
View Full Code Here

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

  @Test
  public void testGetAppReport() {
    RMApp app = createNewTestApp(null);
    assertAppState(RMAppState.NEW, app);
    ApplicationReport report = app.createAndGetApplicationReport(null, true);
    Assert.assertNotNull(report.getApplicationResourceUsageReport());
    report = app.createAndGetApplicationReport("clientuser", true);
    Assert.assertNotNull(report.getApplicationResourceUsageReport());
  }
View Full Code Here

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

  public void testClientTokens() throws Exception {
    assumeTrue(isSecurityEnabled);

    RMApp app = createNewTestApp(null);
    assertAppState(RMAppState.NEW, app);
    ApplicationReport report = app.createAndGetApplicationReport(null, true);
    Assert.assertNull(report.getClientToAMToken());
    report = app.createAndGetApplicationReport("clientuser", true);
    Assert.assertNull(report.getClientToAMToken());

    app = testCreateAppRunning(null);
    rmDispatcher.await();
    assertAppState(RMAppState.RUNNING, app);
    report = app.createAndGetApplicationReport(null, true);
    Assert.assertNull(report.getClientToAMToken());
    report = app.createAndGetApplicationReport("clientuser", true);
    Assert.assertNotNull(report.getClientToAMToken());

    // kill the app attempt and verify client token is unavailable
    app.handle(new RMAppEvent(app.getApplicationId(), RMAppEventType.KILL));
    rmDispatcher.await();
    assertAppAndAttemptKilled(app);
    report = app.createAndGetApplicationReport(null, true);
    Assert.assertNull(report.getClientToAMToken());
    report = app.createAndGetApplicationReport("clientuser", true);
    Assert.assertNull(report.getClientToAMToken());
  }
View Full Code Here

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

    GetApplicationReportRequest request =
        Records.newRecord(GetApplicationReportRequest.class);
    request.setApplicationId(app.getApplicationId());
    GetApplicationReportResponse reportResponse =
        rm.getClientRMService().getApplicationReport(request);
    ApplicationReport appReport = reportResponse.getApplicationReport();
    org.apache.hadoop.yarn.api.records.Token originalClientToAMToken =
        appReport.getClientToAMToken();

    ApplicationAttemptId appAttempt = app.getCurrentAppAttempt().getAppAttemptId();
    final MockAM mockAM =
        new MockAM(rm.getRMContext(), rm.getApplicationMasterService(),
            app.getCurrentAppAttempt().getAppAttemptId());
View Full Code Here

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

  public void waitForApp(ApplicationId appId, long timeout) {
        boolean repeat = false;
    long start = System.currentTimeMillis();
        do {
            try {
                ApplicationReport appReport = client.getApplicationReport(appId);
                YarnApplicationState appState = appReport.getYarnApplicationState();
                repeat = (appState != YarnApplicationState.FINISHED && appState != YarnApplicationState.KILLED && appState != YarnApplicationState.FAILED);
                if (repeat) {
                    Thread.sleep(500);
                }
            } catch (Exception ex) {
View Full Code Here

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

    }

    private void start() {
        ClientRpc client = new ClientRpc(getConf());
        ApplicationId id = null;
        ApplicationReport report = null;

        try {
            YarnLauncher launcher = new YarnLauncher(client, cfg);
            id = launcher.run();
            report = client.getReport(id);
        } finally {
            client.close();
        }

        System.out.println(String.format("Launched a %d %s Elasticsearch-YARN cluster [%s@%s] at %tc",
                cfg.containersToAllocate(), (cfg.containersToAllocate() > 1 ? "nodes" : "node"), id, report.getTrackingUrl(), report.getStartTime()));
    }
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.