in xtable-api/src/main/java/org/apache/xtable/spi/sync/CatalogSync.java [52:85]
public SyncResult syncTable(
Map<CatalogTableIdentifier, CatalogSyncClient> catalogSyncClients, InternalTable table) {
List<CatalogSyncStatus> results = new ArrayList<>();
Instant startTime = Instant.now();
catalogSyncClients.forEach(
((tableIdentifier, catalogSyncClient) -> {
try {
results.add(syncCatalog(catalogSyncClient, tableIdentifier, table));
log.info(
"Catalog sync is successful for table {} with base path {} and format {} using catalogSync {}",
tableIdentifier.getId(),
table.getBasePath(),
table.getTableFormat(),
catalogSyncClient.getClass().getName());
} catch (Exception e) {
log.error(
"Catalog sync failed for table {} with base path {} and format {} using catalogSync {}",
tableIdentifier.getId(),
table.getBasePath(),
table.getTableFormat(),
catalogSyncClient.getClass().getName(),
e);
results.add(
getCatalogSyncFailureStatus(
catalogSyncClient.getCatalogId(), catalogSyncClient.getClass().getName(), e));
}
}));
return SyncResult.builder()
.lastInstantSynced(table.getLatestCommitTime())
.syncStartTime(startTime)
.syncDuration(Duration.between(startTime, Instant.now()))
.catalogSyncStatusList(results)
.build();
}