private Map<String, String> mergeProperties(Map<String, String> originalProperties,
                               Map<String, String> newProperties,
                               boolean updateIfExists, Multimap<AbstractUpgradeCatalog.ConfigUpdateType, Entry<String, String>> propertiesToLog) {

    Map<String, String> properties = new HashMap<>(originalProperties);
    for (Map.Entry<String, String> entry : newProperties.entrySet()) {
      if (!properties.containsKey(entry.getKey())) {
        properties.put(entry.getKey(), entry.getValue());
        propertiesToLog.put(ConfigUpdateType.ADDED, entry);
      }
      if (updateIfExists)  {
        properties.put(entry.getKey(), entry.getValue());
        propertiesToLog.put(ConfigUpdateType.UPDATED, entry);
      }
    }
    return properties;
  }
Create a new cluster scoped configuration with the new properties added
to the existing set of properties.
@param configType Configuration type. (hdfs-site, etc.)
@param properties Map of key value pairs to add / update.
ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java