private String updateValue(String configType,
                             String propertyName,
                             String oldValue,
                             PropertyUpdater updater,
                             Map<String, Map<String, String>> allProps,
                             Configuration configuration,
                             Set<String> configTypesUpdated,
                             boolean alwaysUpdateConfig) {
    String newValue = updater.updateForClusterCreate(propertyName, oldValue, allProps, clusterTopology);
    if (null != newValue) {
      if (!newValue.equals(oldValue)) {
        configTypesUpdated.add(configType);
      }
      if (!newValue.equals(oldValue) || alwaysUpdateConfig) {
        configuration.setProperty(configType, propertyName, newValue);
      }
    }
    return newValue;
  }
Encapsulates commonly repeated tasks around updating a configuration value during cluster creation.
@param configType the configuration type (e.g. hdfs-site)
@param propertyName the name of the property (e.g. dfs.namenode.name.dir)
@param oldValue the old value of the property
@param updater the property updater to use
@param allProps other properties to be considered by the updater
@param configuration configuration to update (cluster global config or hostgroup config)
@param configTypesUpdated set of updated config types (configType param will be added if updater changes the
                          value of the property)
@param alwaysUpdateConfig boolean to indicate whether the {@link Configuration} received as parameter should always
                          (except when new value is {@code null}) be updated or only in case the new value differs
                          from the original. (TODO: what is the reason for always updating the configuration?)
@return the updated value
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java