public void getAndMergeHostConfigs(Map<String, Map<String, String>> configurations,
                                     Map<String, Map<String, String>> configurationTags,
                                     Cluster cluster) {
    if (null != configurationTags && !configurationTags.isEmpty()) {
      Map<String, Map<String, String>> configProperties =
          getEffectiveConfigProperties(cluster, configurationTags);

      // Apply the configurations present before on top of derived configs
      for (Map.Entry<String, Map<String, String>> entry : configProperties.entrySet()) {
        String type = entry.getKey();
        Map<String, String> allLevelMergedConfig = entry.getValue();

        if (configurations.containsKey(type)) {
          Map<String, String> mergedConfig = getMergedConfig(allLevelMergedConfig,
              configurations.get(type));

          configurations.get(type).clear();
          configurations.get(type).putAll(mergedConfig);

        } else {
          configurations.put(type, new HashMap<>());
          configurations.get(type).putAll(allLevelMergedConfig);
        }
      }
    }
  }
Retrieves effective configurations for specified cluster and tags and merge them with
present before in {@code configurations}
@param configurations configurations will be merged with effective cluster configurations
@param configurationTags configuration tags for cluster's desired configs
@param cluster cluster to configs retrieving
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java