public AgentConfigsUpdateEvent getHostActualConfigsExcludeCluster(Long hostId, Long clusterId) throws AmbariException {
    TreeMap<String, ClusterConfigs> clustersConfigs = new TreeMap<>();

    Host host = clusters.getHostById(hostId);
    for (Cluster cl : clusters.getClusters().values()) {
      if (clusterId != null && cl.getClusterId() == clusterId) {
        continue;
      }
      Map<String, Map<String, String>> configurations = new HashMap<>();
      Map<String, Map<String, Map<String, String>>> configurationAttributes = new HashMap<>();
      Map<String, DesiredConfig> clusterDesiredConfigs = cl.getDesiredConfigs(false);
      Map<String, Map<String, String>> configTags = getEffectiveDesiredTags(cl, host.getHostName(), clusterDesiredConfigs);

      // Logging below creating too much spam and slowing down operations
      if (LOG.isDebugEnabled()) {
        LOG.debug("For configs update on host {} will be used cluster entity {}", hostId, cl.getClusterEntity().toString());
        LOG.debug("For configs update on host {} will be used following cluster desired configs {}", hostId, clusterDesiredConfigs.toString());
        LOG.debug("For configs update on host {} will be used following effective desired tags {}", hostId, configTags.toString());
      }

      getAndMergeHostConfigs(configurations, configTags, cl);
      configurations = unescapeConfigNames(configurations);
      getAndMergeHostConfigAttributes(configurationAttributes, configTags, cl);
      configurationAttributes = unescapeConfigAttributeNames(configurationAttributes);

      SortedMap<String, SortedMap<String, String>> configurationsTreeMap = sortConfigutations(configurations);
      SortedMap<String, SortedMap<String, SortedMap<String, String>>> configurationAttributesTreeMap =
          sortConfigurationAttributes(configurationAttributes);
      clustersConfigs.put(Long.toString(cl.getClusterId()),
          new ClusterConfigs(configurationsTreeMap, configurationAttributesTreeMap));
    }

    return new AgentConfigsUpdateEvent(hostId, clustersConfigs);
  }
Collects actual configurations and configuration attributes for specified host.
@param hostId host id to collect configurations and configuration attributes
@return event ready to send to agent
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java