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

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


        "--spring.yarn.client.launchcontext.archiveFile=" + APPMASTER_ARCHIVE
    };

    ApplicationId applicationId = submitApp.run(args);

    YarnApplicationState state = waitState(applicationId, 60, TimeUnit.SECONDS, YarnApplicationState.FINISHED, YarnApplicationState.FAILED);
    assertThat(state, is(YarnApplicationState.FINISHED));
  }
View Full Code Here


    return properties;
  }

  protected YarnApplicationState waitState(ApplicationId applicationId, long timeout, TimeUnit unit,
      YarnApplicationState... applicationStates) throws Exception {
    YarnApplicationState state = null;
    long end = System.currentTimeMillis() + unit.toMillis(timeout);

    // break label for inner loop
    done: do {
      state = findState(getYarnClient(), applicationId);
      if (state == null) {
        break;
      }
      for (YarnApplicationState stateCheck : applicationStates) {
        if (state.equals(stateCheck)) {
          break done;
        }
      }
      Thread.sleep(1000);
    } while (System.currentTimeMillis() < end);
View Full Code Here

    } while (System.currentTimeMillis() < end);
    return state;
  }

  protected YarnApplicationState findState(YarnClient client, ApplicationId applicationId) {
    YarnApplicationState state = null;
    for (ApplicationReport report : client.listApplications()) {
      if (report.getApplicationId().equals(applicationId)) {
        state = report.getYarnApplicationState();
        break;
      }
View Full Code Here

        "--spring.yarn.client.launchcontext.archiveFile=" + APPMASTER_ARCHIVE
    };

    ApplicationId applicationId = submitApp.run(submitArgs);

    YarnApplicationState state = waitState(applicationId, 60, TimeUnit.SECONDS, YarnApplicationState.FINISHED,
        YarnApplicationState.FAILED, YarnApplicationState.RUNNING);
    assertThat(state, is(YarnApplicationState.RUNNING));

    // kill
    YarnKillApplication killApp = new YarnKillApplication();
View Full Code Here

    assertThat(client, notNullValue());

    ApplicationId applicationId = client.submitApplication();
    assertThat(applicationId, notNullValue());

    YarnApplicationState state = null;
    for (int i = 0; i<120; i++) {
      state = findState(client, applicationId);
      if (state == null) {
        break;
      }
      if (state.equals(YarnApplicationState.FINISHED) || state.equals(YarnApplicationState.FAILED)) {
        break;
      }
      Thread.sleep(1000);
    }
    assertThat(state, notNullValue());
View Full Code Here

      }
    }
  }

  private YarnApplicationState findState(YarnClient client, ApplicationId applicationId) {
    YarnApplicationState state = null;
    for (ApplicationReport report : client.listApplications()) {
      if (report.getApplicationId().equals(applicationId)) {
        state = report.getYarnApplicationState();
        break;
      }
View Full Code Here

    final String queue = newQueue();
    final long start = 123456 + i * 1000;
    final long finish = 234567 + i * 1000;
    final String type = YarnConfiguration.DEFAULT_APPLICATION_TYPE;
    YarnApplicationState[] allStates = YarnApplicationState.values();
    final YarnApplicationState state = allStates[i % allStates.length];
    final int maxAppAttempts = i % 1000;
    return new ApplicationBase() {
      @Override
      public ApplicationId getApplicationId() {
        return appAttemptId.getApplicationId();
View Full Code Here

    if (null == report) {
      forceKillApplication("Reached client specified timeout for application");
      return EXIT_TIMED_OUT;
    }

    YarnApplicationState state = report.getYarnApplicationState();
    FinalApplicationStatus dsStatus = report.getFinalApplicationStatus();
    switch (state) {
      case FINISHED:
        if (FinalApplicationStatus.SUCCEEDED == dsStatus) {
          log.info("Application has completed successfully");
View Full Code Here

        return EXIT_FALSE;
      } else {
        // the app exists, but it may be in a terminated state
        SliderUtils.OnDemandReportStringifier report =
          new SliderUtils.OnDemandReportStringifier(instance);
        YarnApplicationState state =
          instance.getYarnApplicationState();
        if (state.ordinal() >= YarnApplicationState.FINISHED.ordinal()) {
          //cluster in the list of apps but not running
          log.info("Cluster {} found but is in state {}", name, state);
          log.debug("State {}", report);
          return EXIT_FALSE;
        }
View Full Code Here

      ApplicationReport r = getApplicationReport(appId);

      log.debug("queried status is\n{}",
                new SliderUtils.OnDemandReportStringifier(r));

      YarnApplicationState state = r.getYarnApplicationState();
      if (state.ordinal() >= desiredState.ordinal()) {
        log.debug("App in desired state (or higher) :{}", state);
        return r;
      }
      if (duration.getLimitExceeded()) {
        log.debug(
View Full Code Here

TOP

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

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.