protected void updateConfigurationPropertiesWithValuesFromXml(String configType,
                                                                Set<String> propertyNames,
                                                                Set<String> toRemove,
                                                                boolean updateIfExists,
                                                                boolean createNewConfigType) throws AmbariException {
    Clusters clusters = injector.getInstance(Clusters.class);
    ConfigHelper configHelper = injector.getInstance(ConfigHelper.class);
    if (clusters == null) {
      return;
    }
    Map<String, Cluster> clusterMap = clusters.getClusters();

    if (clusterMap != null && !clusterMap.isEmpty()) {
      for (Cluster cluster : clusterMap.values()) {
        Map<String, String> properties = new HashMap<>();

        for(String propertyName:propertyNames) {
          String propertyValue = configHelper.getPropertyValueFromStackDefinitions(cluster, configType, propertyName);

          if(propertyValue == null) {
            LOG.info("Config " + propertyName + " from " + configType + " is not found in xml definitions." +
                "Skipping configuration property update");
            continue;
          }

          ServiceInfo propertyService = configHelper.getPropertyOwnerService(cluster, configType, propertyName);
          if(propertyService != null && !cluster.getServices().containsKey(propertyService.getName())) {
            LOG.info("Config " + propertyName + " from " + configType + " with value = " + propertyValue + " " +
                "Is not added due to service " + propertyService.getName() + " is not in the cluster.");
            continue;
          }

          properties.put(propertyName, propertyValue);
        }

        updateConfigurationPropertiesForCluster(cluster, configType,
            properties, toRemove, updateIfExists, createNewConfigType);
      }
    }
  }
Create a new cluster scoped configuration with the new properties added
with the values from the coresponding xml files.

If xml owner service is not in the cluster, the configuration won't be added.

@param configType Configuration type. (hdfs-site, etc.)
@param propertyNames Set property names.
ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java