public Pair<Map<String, Map<String, String>>, Map<String, Map<String, Map<String, String>>>> calculateExistingConfigs(Cluster cluster) throws AmbariException {
    Map<String, Map<String, String>> desiredConfigTags = getEffectiveDesiredTags(cluster, null);
    return Pair.of(
      getEffectiveConfigProperties(cluster, desiredConfigTags),
      getEffectiveConfigAttributes(cluster, desiredConfigTags)
    );
  }
Determines the existing configurations for the cluster, both properties and attributes.
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java