public void dataValidateWithServer()

in backup-core/src/main/java/org/apache/iotdb/backup/core/service/CsvFileValidationService.java [45:75]


  public void dataValidateWithServer(
      String path, Session session, String charset, ValidationType type) throws Exception {
    File fi = validateFilePath(path);
    long size = fi.length();
    if (size >= 200 * 1024 * 1024) {
      throw new FileTransFormationException("the max supported file size is 200MB");
    }
    if (!fi.getName().endsWith(".csv")) {
      throw new FileTransFormationException("given file is not a csv file");
    }

    CsvFileTransParser parser = new CsvFileTransParser(fi, charset);
    List<CSVRecord> allList = new ArrayList<>();
    List<CSVRecord> batchList = new ArrayList();
    try {
      while ((batchList = parser.nextBatchRecords(10000)).size() != 0) {
        allList.addAll(batchList);
      }
    } catch (Exception e) {

    } finally {
      parser.close();
    }
    if (allList.size() == 0) {
      return;
    }
    List<String> timeseries = new ArrayList<>();
    Map<String, String> headMap = new HashMap<>();
    getTimeseries(parser, allList.get(0), timeseries, headMap);
    doDataValidation(allList, timeseries, headMap, session, type);
  }