private void buildAndCreateIdealState(String dcName, String resourceName,
      List<Map.Entry<String, Set<String>>> partitionsUnderResource) {
    IdealState idealState = buildIdealState(dcName, resourceName, partitionsUnderResource);
    HelixAdmin dcAdmin = adminForDc.get(dcName);
    if (!dryRun) {
      dcAdmin.addResource(clusterName, resourceName, idealState);
      info("[{}] Added {} new partitions under resource {} in datacenter {}", dcName.toUpperCase(),
          partitionsUnderResource.size(), resourceName, dcName);
    } else {
      info("[{}] Under DryRun mode, {} new partitions are added to resource {} in datacenter {}", dcName.toUpperCase(),
          partitionsUnderResource.size(), resourceName, dcName);
    }
    resourcesAdded.getAndIncrement();
  }
Build and create a new IdealState for the given resource name and partition layout.
@param dcName The name of the datacenter
@param resourceName The name of the newly created resource
@param partitionsUnderResource The partition layout
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixBootstrapUpgradeUtil.java