static void updateResourceIdealState(String destZkString, String destClusterName, VcrHelixConfig config,
      boolean dryRun) {
    HelixAdmin destAdmin = new ZKHelixAdmin(destZkString);
    Set<String> destResources = new HashSet<>(destAdmin.getResourcesInCluster(destClusterName));

    for (String resource : destResources) {
      IdealState currentIdealState = destAdmin.getResourceIdealState(destClusterName, resource);
      IdealState newIdealState =
          buildIdealState(resource, currentIdealState.getPartitionSet(), config.getIdealStateConfigFields());
      if (dryRun) {
        logger.info("Will update {} to new ideal state {}", resource, newIdealState.toString());
      } else {
        destAdmin.setResourceIdealState(destClusterName, resource, newIdealState);
        logger.info("Updated the ideal state for resource {} ", resource);
        destAdmin.rebalance(destClusterName, resource, config.getIdealStateConfigFields().getNumReplicas(), "", "");
        logger.info("Rebalanced resource with REPLICA_NUM: {}", resource,
            config.getIdealStateConfigFields().getNumReplicas());
      }
    }
  }
Update the resources in the destination cluster with the new IdealState settings.
@param destZkString the destination Zookeeper server string.
@param destClusterName the destination cluster name.
@param dryRun run without actual change.
ambry-commons/src/main/java/com/github/ambry/clustermap/HelixVcrUtil.java