public static void bootstrapOrUpgrade(String hardwareLayoutPath, String partitionLayoutPath, String zkLayoutPath,
      String clusterNamePrefix, String dcs, int maxPartitionsInOneResource, boolean dryRun, boolean forceRemove,
      HelixAdminFactory helixAdminFactory, boolean startValidatingClusterManager, String stateModelDef,
      HelixAdminOperation helixAdminOperation, DataNodeConfigSourceType dataNodeConfigSourceType,
      boolean overrideReplicaStatus, int maxInstancesInOneResourceForFullAuto) throws Exception {
    if (dryRun) {
      info("==== This is a dry run ====");
      info("No changes will be made to the information in Helix (except adding the cluster if it does not exist.");
    }
    HelixBootstrapUpgradeUtil clusterMapToHelixMapper =
        new HelixBootstrapUpgradeUtil(hardwareLayoutPath, partitionLayoutPath, zkLayoutPath, clusterNamePrefix, dcs,
            maxPartitionsInOneResource, dryRun, forceRemove, helixAdminFactory, stateModelDef, null, null, null,
            helixAdminOperation, dataNodeConfigSourceType, overrideReplicaStatus, maxInstancesInOneResourceForFullAuto);
    if (dryRun) {
      info("To drop the cluster, run this tool again with the '--dropCluster {}' argument.",
          clusterMapToHelixMapper.clusterName);
    }
    clusterMapToHelixMapper.updateClusterMapInHelix(startValidatingClusterManager);
    if (!dryRun) {
      clusterMapToHelixMapper.validateAndClose();
    }
    clusterMapToHelixMapper.logSummary();
  }
Takes in the path to the files that make up the static cluster map and adds or updates the cluster map information
in Helix to make the two consistent.
@param hardwareLayoutPath the path to the hardware layout file.
@param partitionLayoutPath the path to the partition layout file.
@param zkLayoutPath the path to the zookeeper layout file.
@param clusterNamePrefix the prefix that when combined with the cluster name in the static cluster map files
                         will give the cluster name in Helix to bootstrap or upgrade.
@param dcs the comma-separated list of data centers that should be updated in this run.
@param maxPartitionsInOneResource the maximum number of Ambry partitions to group under a single Helix resource.
@param dryRun if true, perform a dry run; do not update anything in Helix.
@param forceRemove if true, removes any hosts from Helix not present in the json files.
@param helixAdminFactory the {@link HelixAdminFactory} to use to instantiate {@link HelixAdmin}, can be null.
@param startValidatingClusterManager whether validation should include starting up a {@link HelixClusterManager}
@param stateModelDef the state model definition to use in Ambry cluster.
@param helixAdminOperation the {@link HelixAdminOperation} to perform on resources (partitions). This is used in
                          the context of move replica. So it only updates IdealState without touching anything else.
                          InstanceConfig will be updated by nodes themselves.
@param dataNodeConfigSourceType the {@link DataNodeConfigSourceType} to use when bootstrapping cluster.
@param overrideReplicaStatus whether to override sealed/stopped/disabled replica status lists.
@param maxInstancesInOneResourceForFullAuto max number of instances to be assigned under one resource when the resources
                                            are in full auto compatible mode.
@throws IOException if there is an error reading a file.
@throws JSONException if there is an error parsing the JSON content in any of the files.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixBootstrapUpgradeUtil.java