private void verifyEquivalencyWithStaticClusterMap(HardwareLayout hardwareLayout, PartitionLayout partitionLayout)
      throws Exception {
    String clusterNameInStaticClusterMap = hardwareLayout.getClusterName();
    info("Verifying equivalency of static cluster: " + clusterNameInStaticClusterMap + " with the "
        + "corresponding cluster in Helix: " + clusterName);
    CountDownLatch verificationLatch = new CountDownLatch(adminForDc.size());
    AtomicInteger errorCount = new AtomicInteger();
    for (Datacenter dc : hardwareLayout.getDatacenters()) {
      HelixAdmin admin = adminForDc.get(dc.getName());
      if (admin == null) {
        info("Skipping {}", dc.getName());
        continue;
      }
      ensureOrThrow(isClusterPresent(dc.getName()),
          "Cluster not found in ZK " + dataCenterToZkAddress.get(dc.getName()));
      Utils.newThread(() -> {
        try {
          if (anyResourceInFullAuto(dc.getName())) {
            info("[{}] There are FULL AUTO resource, skip verification", dc.getName());
          } else {
            verifyResourcesAndPartitionEquivalencyInDc(dc, clusterName, partitionLayout);
            verifyDataNodeAndDiskEquivalencyInDc(dc, clusterName, partitionLayout);
            // Remove dc from dcToResourceIdToIdealState, so we fetch all the data from helix again.
            dcToResourceIdToIdealState.remove(dc.getName());
            maybeVerifyResourcesAreFullAutoCompatible(dc.getName(), clusterName, admin,
                maxInstancesInOneResourceForFullAuto);
          }
        } catch (Throwable t) {
          logger.error("[{}] error message: {}", dc.getName().toUpperCase(), t.getMessage());
          errorCount.getAndIncrement();
        } finally {
          verificationLatch.countDown();
        }
      }, false).start();
    }
    verificationLatch.await(10, TimeUnit.MINUTES);
    ensureOrThrow(errorCount.get() == 0, "Error occurred when verifying equivalency with static cluster map");
    info("Successfully verified equivalency of static cluster: " + clusterNameInStaticClusterMap
        + " with the corresponding cluster in Helix: " + clusterName);
  }
Verify that the information in Helix and the information in the static clustermap are equivalent.
@param hardwareLayout the {@link HardwareLayout} of the static clustermap.
@param partitionLayout the {@link PartitionLayout} of the static clustermap.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixBootstrapUpgradeUtil.java