private Map<String, Map<String, Map<String, String>>> calculateExistingConfigurations(Cluster cluster) throws AmbariException {
    Map<String, Map<String, String>> configurationTags = configHelper.getEffectiveDesiredTags(cluster, null);
    Map<String, Map<String, String>> effectiveConfigs = configHelper.getEffectiveConfigProperties(cluster, configurationTags);

    Map<String, Map<String, Map<String, String>>> requestConfigurations = new HashMap<>();
    if (effectiveConfigs != null) {
      for (Map.Entry<String, Map<String, String>> configuration : effectiveConfigs.entrySet()) {
        Map<String, Map<String, String>> properties = new HashMap<>();
        String configType = configuration.getKey();
        Map<String, String> configurationProperties = new HashMap<>(configuration.getValue());

        properties.put("properties", configurationProperties);
        requestConfigurations.put(configType, properties);
      }
    }

    return requestConfigurations;
  }
Calculate the current configurations for all services

@param cluster
         the cluster
@return a map of services and their configurations
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariServerStackAdvisorAwareConfigurationHandler.java