private String getClusterName() throws ConfigurationTopologyException {
    String clusterNameToReturn = null;
    try {
      clusterNameToReturn = clusterTopology.getAmbariContext().getClusterName(clusterTopology.getClusterId());
    } catch (AmbariException e) {
      throw new ConfigurationTopologyException("Cluster name could not obtained, this may indicate a deployment or configuration error.", e);
    }

    if (clusterNameToReturn == null) {
      throw new ConfigurationTopologyException("Cluster name could not obtained, this may indicate a deployment or configuration error.");
    }

    return clusterNameToReturn;
  }
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