public List<DataNode> getAllDataNodesFromDc(String dc) {
      List<DataNode> dataNodes = new ArrayList<>();
      for (Datacenter dcObj : hardwareLayout.getDatacenters()) {
        if (dcObj.getName().equals(dc)) {
          dataNodes.addAll(dcObj.getDataNodes());
          break;
        }
      }
      return dataNodes;
    }
Get all data nodes that are from given data center.
@param dc the data center to get nodes from.
@return a list of nodes from given data center.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/TestUtils.java