Java Code Examples for org.apache.hadoop.yarn.api.records.FinalApplicationStatus#valueOf()

The following examples show how to use org.apache.hadoop.yarn.api.records.FinalApplicationStatus#valueOf() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HadoopStatusGetter.java    From Kylin with Apache License 2.0 5 votes vote down vote up
public Pair<RMAppState, FinalApplicationStatus> get() throws IOException {
    String applicationId = mrJobId.replace("job", "application");
    String url = yarnUrl.replace("${job_id}", applicationId);
    JsonNode root = new ObjectMapper().readTree(getHttpResponse(url));
    RMAppState state = RMAppState.valueOf(root.findValue("state").getTextValue());
    FinalApplicationStatus finalStatus = FinalApplicationStatus.valueOf(root.findValue("finalStatus").getTextValue());
    return Pair.of(state, finalStatus);
}
 
Example 2
Source File: ProtoUtils.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public static FinalApplicationStatus convertFromProtoFormat(FinalApplicationStatusProto e) {
  return FinalApplicationStatus.valueOf(e.name().replace(FINAL_APPLICATION_STATUS_PREFIX, ""));
}
 
Example 3
Source File: ProtoUtils.java    From big-c with Apache License 2.0 4 votes vote down vote up
public static FinalApplicationStatus convertFromProtoFormat(FinalApplicationStatusProto e) {
  return FinalApplicationStatus.valueOf(e.name().replace(FINAL_APPLICATION_STATUS_PREFIX, ""));
}