public MaintenanceState getEffectiveState(ServiceComponentHost sch, Host host)
      throws AmbariException {
    Cluster cluster = clusters.getCluster(sch.getClusterName());
    Service service = cluster.getService(sch.getServiceName());

    if (null == host) {
      throw new HostNotFoundException(cluster.getClusterName(),
          sch.getHostName());
    }

    return getEffectiveState(cluster.getClusterId(), service, host, sch);
  }
Get effective state of HostComponent

@param sch
         the host component
@param host
         the host
@return the maintenance state
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/controller/MaintenanceStateHelper.java