public Set<String> applyUpdatesToStackDefaultProperties(Configuration stackDefaultConfig, Map<String, Map<String, String>> existingConfigurations, Map<String, Map<String, String>> updatedConfigs) {
    Set<String> updatedConfigTypes = new HashSet<>();

    Map<String, Map<String, String>> stackDefaults = stackDefaultConfig.getProperties();

    for (Map.Entry<String, Map<String, String>> configEntry : updatedConfigs.entrySet()) {
      String configType = configEntry.getKey();
      Map<String, String> propertyMap = configEntry.getValue();
      Map<String, String> clusterConfigProperties = existingConfigurations.get(configType);
      Map<String, String> stackDefaultConfigProperties = stackDefaults.get(configType);
      for (Map.Entry<String, String> propertyEntry : propertyMap.entrySet()) {
        String property = propertyEntry.getKey();
        String newValue = propertyEntry.getValue();
        String currentValue = getPropertyValue(configType, property);

        if (!propertyHasCustomValue(clusterConfigProperties, stackDefaultConfigProperties, property) && !Objects.equals(currentValue, newValue)) {
          LOG.debug("Update config property {}/{}: {} -> {}", configType, property, currentValue, newValue);
          setProperty(configType, property, newValue);
          updatedConfigTypes.add(configType);
        }
      }
    }

    return updatedConfigTypes;
  }
Apply configuration changes from {@code updatedConfigs} to {@code config}, but only
change properties that are either absent in the existing config, or have values that
match the stack default config.

@return config types that had any updates applied
ambari-server/src/main/java/org/apache/ambari/server/topology/Configuration.java