DataNodeConfig createConfig(int numDisks, int numReplicasPerDisk) {
    String hostname = "host" + counter++;
    int port = 2222;
    String instanceName = ClusterMapUtils.getInstanceName(hostname, port);
    DataNodeConfig dataNodeConfig =
        new DataNodeConfig(instanceName, hostname, port, DC_NAME, port + 1, port + 2, "rack",
            ClusterMapUtils.DEFAULT_XID);
    int nextPartitionId = 0;
    for (int i = 0; i < numDisks; i++) {
      DataNodeConfig.DiskConfig diskConfig = new DataNodeConfig.DiskConfig(HardwareState.AVAILABLE, 2000);
      for (int j = 0; j < numReplicasPerDisk; j++) {
        int partitionId = nextPartitionId++;
        String partitionName = Integer.toString(partitionId);
        switch (partitionId % 4) {
          case 0:
            break;
          case 1:
            dataNodeConfig.getSealedReplicas().add(partitionName);
            break;
          case 2:
            dataNodeConfig.getStoppedReplicas().add(partitionName);
            break;
          case 3:
            dataNodeConfig.getDisabledReplicas().add(partitionName);
            break;
        }
        diskConfig.getReplicaConfigs().put(partitionName, new DataNodeConfig.ReplicaConfig(10, "class"));
      }
      dataNodeConfig.getDiskConfigs().put("/" + i, diskConfig);
    }
    return dataNodeConfig;
  }
@param numDisks the number of disks to include in the config
@param numReplicasPerDisk the number of replicas to include on each disk in the config.
@return a generated {@link DataNodeConfig} to use in tests.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/DataNodeConfigSourceTestBase.java