code: DatanodeInfo[] getDatanodes(DatanodeReportType type) {
      ArrayList<DatanodeDescriptor> results = getDatanodeListForReport(type);
      DatanodeInfo[] arr = new DatanodeInfo[results.size()];
      for (int i = 0; i < arr.length; i++) {
        arr[i] = new DatanodeInfo(results.get(i));
      }
      return arr;
    }
docs: Get all the datanodes of the given type
  @param type type of the datanodes
  @return a list of datanodes