public void removePropertiesFromAmbariProperties(Collection<String> propertiesToBeRemoved) throws AmbariException {
    final Properties existingProperties = readConfigFile();
    propertiesToBeRemoved.forEach(key -> {
      existingProperties.remove(key);
    });
    writeConfigFile(existingProperties, false);

    // reloading properties
    properties = readConfigFile();
  }
Removing the given properties from ambari.properties (i.e. at upgrade time)

@param propertiesToBeCleared
         the properties to be removed
@throws AmbariException
          if there was any issue when clearing ambari.properties
ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java