public void setConfigurationsOnCluster(ClusterTopology clusterTopology, String tag, Set<String> updatedConfigTypes)  {
    //todo: also handle setting of host group scoped configuration which is updated by config processor
    List<BlueprintServiceConfigRequest> configurationRequests = new LinkedList<>();

    Blueprint blueprint = clusterTopology.getBlueprint();
    Configuration clusterConfiguration = clusterTopology.getConfiguration();

    for (String service : blueprint.getServices()) {
      //todo: remove intermediate request type
      // one bp config request per service
      BlueprintServiceConfigRequest blueprintConfigRequest = new BlueprintServiceConfigRequest(service);

      for (String serviceConfigType : stack.getAllConfigurationTypes(service)) {
        Set<String> excludedConfigTypes = stack.getExcludedConfigurationTypes(service);
        if (!excludedConfigTypes.contains(serviceConfigType)) {
          // skip handling of cluster-env here
          if (! serviceConfigType.equals("cluster-env")) {
            if (clusterConfiguration.getFullProperties().containsKey(serviceConfigType)) {
              blueprintConfigRequest.addConfigElement(serviceConfigType,
                  clusterConfiguration.getFullProperties().get(serviceConfigType),
                  clusterConfiguration.getFullAttributes().get(serviceConfigType));
            }
          }
        }
      }

      configurationRequests.add(blueprintConfigRequest);
    }

    // since the stack returns "cluster-env" with each service's config ensure that only one
    // ClusterRequest occurs for the global cluster-env configuration
    BlueprintServiceConfigRequest globalConfigRequest = new BlueprintServiceConfigRequest("GLOBAL-CONFIG");
    Map<String, String> clusterEnvProps = clusterConfiguration.getFullProperties().get("cluster-env");
    Map<String, Map<String, String>> clusterEnvAttributes = clusterConfiguration.getFullAttributes().get("cluster-env");

    globalConfigRequest.addConfigElement("cluster-env", clusterEnvProps,clusterEnvAttributes);
    configurationRequests.add(globalConfigRequest);

    setConfigurationsOnCluster(configurationRequests, tag, updatedConfigTypes);
  }
Set all configurations on the cluster resource.
@param clusterTopology  cluster topology
@param tag              config tag
ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java