public String setAttribute(String configType, String propertyName, String attributeName, String attributeValue) {
    String previousValue = getAttributeValue(configType, propertyName, attributeName);

    Map<String, Map<String, String>> typeAttributes = attributes.get(configType);
    if (typeAttributes == null) {
      typeAttributes = new HashMap<>();
      attributes.put(configType, typeAttributes);
    }

    Map<String, String> attributes = typeAttributes.get(attributeName);
    if (attributes == null) {
      attributes = new HashMap<>();
      typeAttributes.put(attributeName, attributes);
    }

    attributes.put(propertyName, attributeValue);
    return previousValue;
  }
Set an attribute on the hierarchy.
The attribute will be set on this instance so it will override any value specified in
the parent hierarchy.

@param configType      configuration type
@param propertyName    attribute property name
@param attributeName   attribute name
@param attributeValue  attribute property value

@return the previous value of the attribute or null if it didn't exist
ambari-server/src/main/java/org/apache/ambari/server/topology/Configuration.java