public DataNode getRandomDataNodeFromDc(String dc) {
      Datacenter datacenter = null;
      for (Datacenter dcObj : hardwareLayout.getDatacenters()) {
        if (dcObj.getName().equals(dc)) {
          datacenter = dcObj;
          break;
        }
      }
      if (datacenter == null || datacenter.getDataNodes().size() == 0) {
        return null;
      }
      return datacenter.getDataNodes().get(new Random().nextInt(datacenter.getDataNodes().size()));
    }
@return all existing nodes in hardware layout when this method is being invoked.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/TestUtils.java