@Override
  public Collection<String> getHostGroupsForComponent(String component) {
    Collection<String> resultGroups = new ArrayList<>();
    for (HostGroup group : getBlueprint().getHostGroups().values() ) {
      if (group.getComponentNames().contains(component)) {
        resultGroups.add(group.getName());
      }
    }
    return resultGroups;
  }
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