public void setRoutingTableSnapshot(RoutingTableSnapshot routingTableSnapshot) {
      Map<String, ExternalView> externalViewMap = new ConcurrentHashMap<>();
      if (routingTableSnapshot != null) {
        for (ExternalView externalView : routingTableSnapshot.getExternalViews()) {
          externalViewMap.put(externalView.getResourceName(), externalView);
        }
      }
      if (isAggregatedViewHandler) {
        globalRoutingTableSnapshotRef.getAndSet(routingTableSnapshot);
        globalResourceToExternalView.putAll(externalViewMap);
        globalResourceToExternalView.keySet().retainAll(externalViewMap.keySet());
      } else {
        dcToRoutingTableSnapshotRef.computeIfAbsent(dcName, k -> new AtomicReference<>())
            .getAndSet(routingTableSnapshot);
        dcToResourceToExternalView.put(dcName, externalViewMap);
      }
    }
Sets the helix {@link RoutingTableSnapshot} for a given data center.
@param routingTableSnapshot snapshot of cluster mappings.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixClusterManager.java