// Construct a xref mapping between host->sites and site->partitions
Map<Host, Set<Site>> host_site_xref = new HashMap<Host, Set<Site>>();
Map<Site, Collection<Partition>> site_partition_xref = new HashMap<Site, Collection<Partition>>();
for (Site site_cat : cluster_cat.getSites()) {
Host host_cat = site_cat.getHost();
if (!host_site_xref.containsKey(host_cat)) {
host_site_xref.put(host_cat, new HashSet<Site>());
}
host_site_xref.get(host_cat).add(site_cat);
Collection<Partition> partitions = CollectionUtil.addAll(new HashSet<Partition>(), site_cat.getPartitions());
site_partition_xref.put(site_cat, partitions);
} // FOR
// Hosts
DefaultMutableTreeNode hosts_node = new CatalogMapTreeNode(Host.class, "Hosts", cluster_cat.getHosts());
cluster_node.add(hosts_node);
for (Host host_cat : cluster_cat.getHosts()) {
DefaultMutableTreeNode host_node = new DefaultMutableTreeNode(new WrapperNode(host_cat, host_cat.getIpaddr()));
hosts_node.add(host_node);
buildSearchIndex(host_cat, host_node);
// Sites
if (host_site_xref.containsKey(host_cat)) {