@Override
  public String getHostGroupForHost(String hostname) {
    for (HostGroupInfo groupInfo : hostGroupInfoMap.values() ) {
      if (groupInfo.getHostNames().contains(hostname)) {
        // a host can only be associated with a single host group
        return groupInfo.getHostGroupName();
      }
    }
    return null;
  }
Represents a cluster topology.
Topology includes the the associated blueprint, cluster configuration and hostgroup -> host mapping.
ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterTopologyImpl.java