private ExitCode populateAppStatusFromServiceStatus(String appName, ServiceClient serviceClient,
      AppStatusBuilder appStatusBuilder) throws LlapStatusCliException {
    ExitCode exitCode = ExitCode.YARN_ERROR;
    try {
      Service service = serviceClient.getStatus(appName);
      if (service != null) {
        // How to get config paths and AmInfo
        ServiceState state = service.getState();
        appStatusBuilder.setAppStartTime(service.getLaunchTime() == null ? 0 : service.getLaunchTime().getTime());
        appStatusBuilder.setDesiredInstances(service.getComponent(LLAP_KEY).getNumberOfContainers() == null ? 0
            : service.getComponent(LLAP_KEY).getNumberOfContainers().intValue());
        appStatusBuilder.setLiveInstances(service.getComponent(LLAP_KEY).getContainers().size());
        for (Container cont : service.getComponent(LLAP_KEY).getContainers()) {
          LlapInstance llapInstance = new LlapInstance(cont.getHostname(), cont.getId());
          appStatusBuilder.addNewRunningLlapInstance(llapInstance);
        }
        if (state == ServiceState.STARTED || state == ServiceState.STABLE || state == ServiceState.FLEX) {
          exitCode = ExitCode.SUCCESS;
        }
      } else {
        exitCode = ExitCode.SERVICE_CLIENT_ERROR_OTHER;
      }
    } catch (IOException | YarnException e) {
      LlapStatusCliException le = new LlapStatusCliException(
          ExitCode.SERVICE_CLIENT_ERROR_OTHER, "Failed to get service status", e);
      logError(le);
      exitCode = le.getExitCode();
    }
    return exitCode;
  }
Populates information from YARN Service Status.

@return an ExitCode. An ExitCode other than ExitCode.SUCCESS implies future progress not possible
@throws LlapStatusCliException
llap-server/src/java/org/apache/hadoop/hive/llap/cli/status/LlapStatusServiceDriver.java