private JobStatus yarnStateToSamzaStatus(YarnApplicationState yarnState) {
    switch (yarnState) {
      case RUNNING:
        return JobStatus.STARTED;
      case NEW:
      case NEW_SAVING:
      case SUBMITTED:
      case ACCEPTED:
        return JobStatus.STARTING;
      case FINISHED:
      case FAILED:
      case KILLED:
      default:
        return JobStatus.STOPPED;
    }
  }
Translates the YARN application state to the more generic Samza job status.

@param yarnState the YARN application state to translate.
@return the corresponding Samza job status.
samza-rest/src/main/java/org/apache/samza/rest/proxy/job/YarnRestJobStatusProvider.java