in backup-core/src/main/java/org/apache/iotdb/backup/core/service/CsvFileValidationService.java [77:127]
public void doDataValidation(
List<CSVRecord> allList,
List<String> timeseries,
Map<String, String> headMap,
Session session,
ValidationType type)
throws StatementExecutionException, IoTDBConnectionException {
Map<Long, CSVRecord> csvMap = new HashMap<>();
csvMap =
allList.stream()
.collect(
Collectors.toMap(
c -> {
if (c.get("Time") != null && !"".equals(c.get("Time"))) {
return CsvFileTransParser.formatToTimestamp(c.get("Time"));
}
return 0L;
},
Function.identity()));
long end =
csvMap.keySet().stream()
.max(
(o1, o2) -> {
if (o1 > o2) {
return 1;
} else if (o1 < o2) {
return -1;
} else {
return 0;
}
})
.get();
long begin =
csvMap.keySet().stream()
.min(
(o1, o2) -> {
if (o1 > o2) {
return 1;
} else if (o1 < o2) {
return -1;
} else {
return 0;
}
})
.get();
end += 1;
doValidateData(csvMap, begin, end, timeseries, headMap, session, type);
}