gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-17 16:36:40 27 4
gpt4 key购买 nike

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

YarnApplicationState.valueOf介绍

暂无

代码示例

代码示例来源:origin: uber/AthenaX

static StateView computeState(Map<UUID, JobDefinition> jobs, Map<UUID, InstanceInfo> instances) {
 // Instance ID -> JobDefinition ID
 HashMap<UUID, UUID> instanceToJob = new HashMap<>();
 HashMap<UUID, List<InstanceInfo>> jobInstances = new HashMap<>();
 for (Map.Entry<UUID, InstanceInfo> e : instances.entrySet()) {
  YarnApplicationState state = YarnApplicationState.valueOf(e.getValue().status().getState().toString());
  if (!isInstanceAlive(state)) {
   continue;
  }
  UUID jobId = e.getValue().metadata().jobDefinition();
  UUID instanceId = e.getKey();
  instanceToJob.put(instanceId, jobId);
  if (!jobInstances.containsKey(jobId)) {
   jobInstances.put(jobId, new ArrayList<>());
  }
  jobInstances.get(jobId).add(e.getValue());
 }
 jobs.keySet().stream().filter(x -> !jobInstances.containsKey(x))
   .forEach(x -> jobInstances.put(x, Collections.emptyList()));
 return new StateView(jobs, instances, instanceToJob, jobInstances);
}

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

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

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

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

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

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

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

private static Map<YarnApplicationState, Map<String, Long>> buildScoreboard(
  Set<String> states, Set<String> types) {
 Map<YarnApplicationState, Map<String, Long>> scoreboard
   = new HashMap<YarnApplicationState, Map<String, Long>>();
 // default states will result in enumerating all YarnApplicationStates
 assert !states.isEmpty();
 for (String state : states) {
  Map<String, Long> partScoreboard = new HashMap<String, Long>();
  scoreboard.put(
    YarnApplicationState.valueOf(StringUtils.toUpperCase(state)),
    partScoreboard);
  // types is verified no to be empty
  for (String type : types) {
   partScoreboard.put(type, 0L);
  }
 }
 return scoreboard;
}

代码示例来源:origin: org.apache.slider/slider-core

/**
 * Extract the state of a Yarn application --state argument
 * @param state state argument
 * @return the application state
 * @throws BadCommandArgumentsException if the argument did not match
 * any known state
 */
private YarnApplicationState extractYarnApplicationState(String state) throws
  BadCommandArgumentsException {
 YarnApplicationState stateVal;
 try {
  stateVal = YarnApplicationState.valueOf(state.toUpperCase(Locale.ENGLISH));
 } catch (IllegalArgumentException e) {
  throw new BadCommandArgumentsException("Unknown state: " + state);
 }
 return stateVal;
}

代码示例来源:origin: apache/incubator-slider

/**
 * Extract the state of a Yarn application --state argument
 * @param state state argument
 * @return the application state
 * @throws BadCommandArgumentsException if the argument did not match
 * any known state
 */
private YarnApplicationState extractYarnApplicationState(String state) throws
  BadCommandArgumentsException {
 YarnApplicationState stateVal;
 try {
  stateVal = YarnApplicationState.valueOf(state.toUpperCase(Locale.ENGLISH));
 } catch (IllegalArgumentException e) {
  throw new BadCommandArgumentsException("Unknown state: " + state);
 }
 return stateVal;
}

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

private static Map<YarnApplicationState, Map<String, Long>> buildScoreboard(
  Set<String> states, Set<String> types) {
 Map<YarnApplicationState, Map<String, Long>> scoreboard =
   new HashMap<YarnApplicationState, Map<String, Long>>();
 // default states will result in enumerating all YarnApplicationStates
 assert !states.isEmpty();
 for (String state : states) {
  Map<String, Long> partScoreboard = new HashMap<String, Long>();
  scoreboard.put(
    YarnApplicationState.valueOf(StringUtils.toUpperCase(state)),
    partScoreboard);
  // types is verified no to be empty
  for (String type : types) {
   partScoreboard.put(type, 0L);
  }
 }
 return scoreboard;
}

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

private static Map<YarnApplicationState, Map<String, Long>> buildScoreboard(
  Set<String> states, Set<String> types) {
 Map<YarnApplicationState, Map<String, Long>> scoreboard
   = new HashMap<YarnApplicationState, Map<String, Long>>();
 // default states will result in enumerating all YarnApplicationStates
 assert !states.isEmpty();
 for (String state : states) {
  Map<String, Long> partScoreboard = new HashMap<String, Long>();
  scoreboard.put(
    YarnApplicationState.valueOf(StringUtils.toUpperCase(state)),
    partScoreboard);
  // types is verified no to be empty
  for (String type : types) {
   partScoreboard.put(type, 0L);
  }
 }
 return scoreboard;
}

代码示例来源:origin: io.hops/hadoop-yarn-server-common

try {
 YarnApplicationState.valueOf(
   StringUtils.toUpperCase(paramStr.trim()));
} catch (RuntimeException e) {

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

try {
 YarnApplicationState.valueOf(
   StringUtils.toUpperCase(paramStr.trim()));
} catch (RuntimeException e) {

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

try {
 YarnApplicationState.valueOf(
   StringUtils.toUpperCase(paramStr.trim()));
} catch (RuntimeException e) {

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

try {
 YarnApplicationState.valueOf(
   StringUtils.toUpperCase(paramStr.trim()));
} catch (RuntimeException e) {

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

try {
 YarnApplicationState.valueOf(
   StringUtils.toUpperCase(paramStr.trim()));
} catch (RuntimeException e) {

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

private static void
  validateStates(String stateQuery, Set<String> statesQuery) {
 // stateQuery is deprecated.
 if (stateQuery != null && !stateQuery.isEmpty()) {
  statesQuery.add(stateQuery);
 }
 Set<String> appStates = parseQueries(statesQuery, true);
 for (String appState : appStates) {
  switch (YarnApplicationState.valueOf(
    StringUtils.toUpperCase(appState))) {
   case FINISHED:
   case FAILED:
   case KILLED:
    continue;
   default:
    throw new BadRequestException("Invalid application-state " + appState
      + " specified. It should be a final state");
  }
 }
}

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

private static void
  validateStates(String stateQuery, Set<String> statesQuery) {
 // stateQuery is deprecated.
 if (stateQuery != null && !stateQuery.isEmpty()) {
  statesQuery.add(stateQuery);
 }
 Set<String> appStates = parseQueries(statesQuery, true);
 for (String appState : appStates) {
  switch (YarnApplicationState.valueOf(
    StringUtils.toUpperCase(appState))) {
   case FINISHED:
   case FAILED:
   case KILLED:
    continue;
   default:
    throw new BadRequestException("Invalid application-state " + appState
      + " specified. It should be a final state");
  }
 }
}

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

private static void
  validateStates(String stateQuery, Set<String> statesQuery) {
 // stateQuery is deprecated.
 if (stateQuery != null && !stateQuery.isEmpty()) {
  statesQuery.add(stateQuery);
 }
 Set<String> appStates = parseQueries(statesQuery, true);
 for (String appState : appStates) {
  switch (YarnApplicationState.valueOf(
    StringUtils.toUpperCase(appState))) {
   case FINISHED:
   case FAILED:
   case KILLED:
    continue;
   default:
    throw new BadRequestException("Invalid application-state " + appState
      + " specified. It should be a final state");
  }
 }
}

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

String[] appStateStrings = reqStateString.split(",");
for (String stateString : appStateStrings) {
 reqAppStates.add(YarnApplicationState.valueOf(stateString.trim()));

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

String[] appStateStrings = reqStateString.split(",");
for (String stateString : appStateStrings) {
 reqAppStates.add(YarnApplicationState.valueOf(stateString.trim()));

代码示例来源:origin: apache/samza

JobStatus samzaStatus = yarnStateToSamzaStatus(YarnApplicationState.valueOf(app.getState().toUpperCase()));

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com