org.apache.hadoop.yarn.api.records.YarnApplicationState.name()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中org.apache.hadoop.yarn.api.records.YarnApplicationState.name()方法的一些代码示例,展示了YarnApplicationState.name()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnApplicationState.name()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.api.records.YarnApplicationState
类名称:YarnApplicationState
方法名:name

YarnApplicationState.name介绍

暂无

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

public static YarnApplicationStateProto convertToProtoFormat(YarnApplicationState e) {
 return YarnApplicationStateProto.valueOf(e.name());
}
public static YarnApplicationState convertFromProtoFormat(YarnApplicationStateProto e) {

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

public static YarnApplicationStateProto convertToProtoFormat(YarnApplicationState e) {
 return YarnApplicationStateProto.valueOf(e.name());
}
public static YarnApplicationState convertFromProtoFormat(YarnApplicationStateProto e) {

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-common

public static YarnApplicationStateProto convertToProtoFormat(YarnApplicationState e) {
 return YarnApplicationStateProto.valueOf(e.name());
}
public static YarnApplicationState convertFromProtoFormat(YarnApplicationStateProto e) {

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

@Override
public synchronized void setApplicationStates(Set<String> applicationStates) {
 EnumSet<YarnApplicationState> appStates = null;
 for (YarnApplicationState state : YarnApplicationState.values()) {
  if (applicationStates.contains(
    StringUtils.toLowerCase(state.name()))) {
   if (appStates == null) {
    appStates = EnumSet.of(state);
   } else {
    appStates.add(state);
   }
  }
 }
 setApplicationStates(appStates);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

@Override
public void setApplicationStates(Set<String> applicationStates) {
 EnumSet<YarnApplicationState> appStates = null;
 for (YarnApplicationState state : YarnApplicationState.values()) {
  if (applicationStates.contains(
    StringUtils.toLowerCase(state.name()))) {
   if (appStates == null) {
    appStates = EnumSet.of(state);
   } else {
    appStates.add(state);
   }
  }
 }
 setApplicationStates(appStates);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-common

@Override
public void setApplicationStates(Set<String> applicationStates) {
 EnumSet<YarnApplicationState> appStates = null;
 for (YarnApplicationState state : YarnApplicationState.values()) {
  if (applicationStates.contains(
    StringUtils.toLowerCase(state.name()))) {
   if (appStates == null) {
    appStates = EnumSet.of(state);
   } else {
    appStates.add(state);
   }
  }
 }
 setApplicationStates(appStates);
}

代码示例来源:origin: ShifuML/guagua

/**
 * Display a formatted summary of the job progress report from the AM.
 * 
 * @param report
 *            the report to display.
 */
private void displayJobReport(final ApplicationReport report) {
  if(null == report) {
    throw new IllegalStateException(String.format(
        "[*] Latest ApplicationReport for job %s was not received by the local client.", getAppName()));
  }
  final float elapsed = (System.currentTimeMillis() - report.getStartTime()) / 1000.0f;
  LOG.info("{}, Elapsed: {}", getAppName(), String.format("%.2f secs", elapsed));
  LOG.info("{}, State: {} , Containers: used/reserved/needed-resources {}/{}/{}", report
      .getCurrentApplicationAttemptId(), report.getYarnApplicationState().name(), report
      .getApplicationResourceUsageReport().getNumUsedContainers(), report.getApplicationResourceUsageReport()
      .getNumReservedContainers(), report.getApplicationResourceUsageReport().getNeededResources());
}

代码示例来源:origin: ml.shifu/guagua-yarn

/**
 * Display a formatted summary of the job progress report from the AM.
 * 
 * @param report
 *            the report to display.
 */
private void displayJobReport(final ApplicationReport report) {
  if(null == report) {
    throw new IllegalStateException(String.format(
        "[*] Latest ApplicationReport for job %s was not received by the local client.", getAppName()));
  }
  final float elapsed = (System.currentTimeMillis() - report.getStartTime()) / 1000.0f;
  LOG.info("{}, Elapsed: {}", getAppName(), String.format("%.2f secs", elapsed));
  LOG.info("{}, State: {} , Containers: used/reserved/needed-resources {}/{}/{}", report
      .getCurrentApplicationAttemptId(), report.getYarnApplicationState().name(), report
      .getApplicationResourceUsageReport().getNumUsedContainers(), report.getApplicationResourceUsageReport()
      .getNumReservedContainers(), report.getApplicationResourceUsageReport().getNeededResources());
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-applications-unmanaged-am-launcher

if (first) {
 first = false;
 expectedFinalState.append(state.name());
} else {
 expectedFinalState.append("," + state.name());

代码示例来源:origin: org.apache.apex/apex-engine

jsonObj.put("id", ar.getApplicationId().getId());
jsonObj.put("name", ar.getName());
jsonObj.put("state", ar.getYarnApplicationState().name());
jsonObj.put("trackingUrl", ar.getTrackingUrl());
jsonObj.put("finalStatus", ar.getFinalApplicationStatus());

代码示例来源:origin: hopshadoop/hopsworks

private void fetchJobs(List<YarnApplicationReport> reports) {
 if (yarnClientWrapper == null) {
  conf = settings.getConfiguration();
  yarnClientWrapper = ycs.getYarnClientSuper(conf);
 }
 try {
  //Create our custom YarnApplicationReport Pojo
  for (ApplicationReport appReport : yarnClientWrapper.getYarnClient()
    .getApplications()) {
   reports.add(new YarnApplicationReport(appReport.getApplicationId().
       toString(),
       appReport.getName(), appReport.getUser(), appReport.
       getStartTime(), appReport.getFinishTime(), appReport.
       getApplicationId().getClusterTimestamp(),
       appReport.getApplicationId().getId(), appReport.
       getYarnApplicationState().name()));
  }
 } catch (YarnException | IOException ex) {
  logger.log(Level.SEVERE, null, ex);
 }
}

代码示例来源:origin: hopshadoop/hopsworks

getApplicationId().getClusterTimestamp(),
   appReport.getApplicationId().getId(), appReport.
   getYarnApplicationState().name()));
    getApplicationId().getClusterTimestamp(),
    appReport.getApplicationId().getId(), appReport.
    getYarnApplicationState().name()));
break;

代码示例来源:origin: org.apache.apex/apex-engine

response.put("user", appReport.getUser());
response.put("state", appReport.getYarnApplicationState().name());
response.put("trackingUrl", appReport.getTrackingUrl());
response.put("finalStatus", appReport.getFinalApplicationStatus());

相关文章