@Override
    public String updateForBlueprintExport(String propertyName,
                                           String value,
                                           Map<String, Map<String, String>> properties,
                                           ClusterTopology topology) {
      for (HostGroupInfo groupInfo : topology.getHostGroupInfo().values()) {
        Collection<String> hosts = groupInfo.getHostNames();
        for (String host : hosts) {
          //todo: need to use regular expression to avoid matching a host which is a superset.
          if (value.contains(host)) {
            return value.replace(host, "%HOSTGROUP::" + groupInfo.getHostGroupName() + "%");
          }
        }
      }

      return value;
    }
Update the property with the new host name which runs the associated component.

@param propertyName name of property
@param origValue    original value of property
@param properties   all properties
@param topology     cluster topology
@return updated property value with old host name replaced by new host name
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java