@Override
  public State getState(String clusterName, String serviceName) {
    try {
      Cluster cluster = getCluster(clusterName);
      if (cluster != null && managementControllerProvider != null) {

        ServiceComponentHostRequest request = new ServiceComponentHostRequest(clusterName,
          serviceName, null, null, null);

        Set<ServiceComponentHostResponse> hostComponentResponses =
          managementControllerProvider.get().getHostComponents(Collections.singleton(request), true);

        State state = State.UNKNOWN;
        for (ServiceComponentHostResponse schr : hostComponentResponses) {
          State schState = getHostComponentState(schr);
          if (schState.ordinal() < state.ordinal()) {
            state = schState;
          }
        }
        return state;
      }
    } catch (AmbariException e) {
      LOG.error("Can't determine service state.", e);
    }
    return State.UNKNOWN;
  }
Determines the service status for Flume.  Generically, this means that
the state of Flume is the lowest ordinal state calculated.  For example:
<ul>
  <li>If all handlers are STARTED, service is STARTED.</li>
  <li>If one handler is INSTALLED, the service is INSTALLED.</li>
</ul>
ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/FlumeServiceCalculatedState.java