Map<String, Set<Integer>> getInstanceToResourceIds(Map<Integer, Set<String>> resourceIdToInstances) {
    Map<String, Set<Integer>> instanceToResourceIds = new HashMap<>();
    for (Map.Entry<Integer, Set<String>> ent : resourceIdToInstances.entrySet()) {
      Integer resourceId = ent.getKey();
      Set<String> instances = ent.getValue();
      instances.forEach(in -> instanceToResourceIds.computeIfAbsent(in, k -> new HashSet<>()).add(resourceId));
    }
    return instanceToResourceIds;
  }
Return a map from instance name to a set of resource ids, given a map from resource ids to a set of instance names.
@param resourceIdToInstances
@return
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixBootstrapUpgradeUtil.java