public Map<String, Map<String, String>> calculateExistingConfigurations(AmbariManagementController ambariManagementController, Cluster cluster) throws AmbariException {
    final Map<String, Map<String, String>> configurations = new HashMap<>();
    for (Host host : cluster.getHosts()) {
      configurations.putAll(calculateExistingConfigurations(
              ambariManagementController,
              cluster,
              host.getHostName(),
              null
      ));
    }
    return configurations;
  }
Determines the existing configurations for the cluster

@param ambariManagementController
         the Ambari management controller
@param cluster
         the cluster
@return a map of the existing configurations
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java