static JSONArray getJsonArrayDataNodesRackAware(int dataNodeCount, String hostname, int basePort, int sslPort,
      int http2Port, int numRacks, HardwareState hardwareState, JSONArray disks) throws JSONException {
    JSONArray jsonArray = new JSONArray();
    for (int i = 0; i < dataNodeCount; ++i) {
      jsonArray.put(
          getJsonDataNode(hostname, basePort + i, sslPort + i, http2Port + i, i % numRacks, DEFAULT_XID, disks,
              hardwareState));
    }
    return jsonArray;
  }
Generates an array of JSON data node objects, each with a defined rack ID.
Increments basePort and sslPort for each node to ensure unique DataNode given same hostname.

@param dataNodeCount how many data nodes to generate
@param hostname the hostname for each node in the array
@param basePort the starting standard port number for nodes generated
@param sslPort the starting SSL port number for nodes generated
@param http2Port the starting HTTP2 port number for nodes generated
@param numRacks how many distinct racks the data nodes should use
@param hardwareState a {@link HardwareLayout} value for each node
@param disks a {@link JSONArray} of disks for each node
@return a {@link JSONArray} of nodes
ambry-clustermap/src/test/java/com/github/ambry/clustermap/TestUtils.java