public Boolean updateConfigType(Cluster cluster, StackId stackId, AmbariManagementController controller,
                                  String configType, Map<String, String> updates,
                                  Collection<String> removals,
                                  String authenticatedUserName,
                                  String serviceVersionNote,
                                  @Nullable Map<String, DesiredConfig> desiredConfig,
                                  Boolean doUpdateAgentConfigs) throws AmbariException {

    // Nothing to update or remove
    if (configType == null ||
      (updates == null || updates.isEmpty()) &&
      (removals == null || removals.isEmpty())) {
      return false;
    }

    Config oldConfig = (desiredConfig != null && desiredConfig.containsKey(configType))
            ? cluster.getConfig(configType, desiredConfig.get(configType).getTag())
            : cluster.getDesiredConfigByType(configType);
    Map<String, String> oldConfigProperties;
    Map<String, String> properties = new HashMap<>();
    Map<String, Map<String, String>> propertiesAttributes = new HashMap<>();

    if (oldConfig == null) {
      oldConfigProperties = null;
    } else {
      oldConfigProperties = oldConfig.getProperties();
      if (oldConfigProperties != null) {
        properties.putAll(oldConfigProperties);
      }
      if (oldConfig.getPropertiesAttributes() != null) {
        propertiesAttributes.putAll(oldConfig.getPropertiesAttributes());
      }
    }

    if (updates != null) {
      properties.putAll(updates);
    }

    // Remove properties that need to be removed.
    if (removals != null) {
      for (String propertyName : removals) {
        properties.remove(propertyName);
        for (Map<String, String> attributesMap: propertiesAttributes.values()) {
          attributesMap.remove(propertyName);
        }
      }
    }

    if ((oldConfigProperties == null || !Maps.difference(oldConfigProperties, properties).areEqual())
            && createConfigType(cluster, stackId, controller, configType, properties, propertiesAttributes,
            authenticatedUserName, serviceVersionNote)) {
      if (doUpdateAgentConfigs) {
        updateAgentConfigs(Collections.singleton(cluster.getClusterName()));
      }

      return true;
    }

    return false;
  }
A helper method to create a new {@link Config} for a given configuration
type and updates to the current values, if any. This method will perform the following tasks:
<ul>
<li>Merge the specified updates with the properties of the current version of the
configuration</li>
<li>Create a {@link Config} in the cluster for the specified type. This
will have the proper versions and tags set automatically.</li>
<li>Set the cluster's {@link DesiredConfig} to the new configuration</li>
<li>Create an entry in the configuration history with a note and username.</li>
<ul>

@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java