in polaris-synchronizer/cli/src/main/java/org/apache/polaris/tools/sync/polaris/CsvETagManager.java [59:94]
public void initialize(Map<String, String> properties) {
if (!properties.containsKey(CSV_FILE_PROPERTY)) {
throw new IllegalArgumentException("Missing required property " + CSV_FILE_PROPERTY);
}
this.file = new File(properties.get(CSV_FILE_PROPERTY));
if (file.exists()) {
CSVFormat readerCSVFormat =
CSVFormat.DEFAULT.builder().setHeader(HEADERS).setSkipHeaderRecord(true).get();
CSVParser parser;
try {
parser = CSVParser.parse(Files.newBufferedReader(file.toPath(), UTF_8), readerCSVFormat);
} catch (IOException e) {
throw new RuntimeException(e);
}
for (CSVRecord record : parser.getRecords()) {
this.tablesByCatalogName.putIfAbsent(record.get(CATALOG_HEADER), new HashMap<>());
TableIdentifier tableId = TableIdentifier.parse(record.get(TABLE_ID_HEADER));
this.tablesByCatalogName
.get(record.get(CATALOG_HEADER))
.put(tableId, record.get(ETAG_HEADER));
}
try {
parser.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}