public Set<Map<String, String>> getMaintenanceHostComponents(
      Clusters clusters, Cluster cluster) throws AmbariException {
    Set<Map<String, String>> set = new HashSet<>();

    Map<String, Host> hosts = clusters.getHostsForCluster(cluster.getClusterName());

    for (Service service : cluster.getServices().values()) {
      for (ServiceComponent sc : service.getServiceComponents().values()) {
        if (sc.isClientComponent()) {
          continue;
        }

        for (ServiceComponentHost sch : sc.getServiceComponentHosts().values()) {
          Host host = hosts.get(sch.getHostName());

          if (MaintenanceState.OFF != getEffectiveState(cluster.getClusterId(),
              service, host, sch)) {
            Map<String, String> map = new HashMap<>();
            map.put("host", sch.getHostName());
            map.put("service", sch.getServiceName());
            map.put("component", sch.getServiceComponentName());
            set.add(map);
          }
        }
      }
    }

    return set;
  }
@param clusters
         the collection of clusters
@param cluster
         the specific cluster to check
@return a property map of all host components that are in a maintenance
        state (either {@link MaintenanceState#ON} or
        {@link MaintenanceState#IMPLIED_FROM_HOST} or
        {@link MaintenanceState#IMPLIED_FROM_SERVICE} or
        {@link MaintenanceState#IMPLIED_FROM_SERVICE_AND_HOST})
ambari-server/src/main/java/org/apache/ambari/server/controller/MaintenanceStateHelper.java