zhoujinsong commented on code in PR #2346:
URL: https://github.com/apache/amoro/pull/2346#discussion_r1626870623
##########
amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/optimizing/maintainer/IcebergTableMaintainer.java:
##########
@@ -570,29 +568,18 @@ private static Set<String> getValidMetadataFiles(Table
internalTable) {
Iterable<Snapshot> snapshots = internalTable.snapshots();
int size = Iterables.size(snapshots);
LOG.info("{} getRuntime {} snapshots to scan", tableName, size);
- int cnt = 0;
for (Snapshot snapshot : snapshots) {
- cnt++;
- int before = validFiles.size();
String manifestListLocation = snapshot.manifestListLocation();
-
validFiles.add(TableFileUtil.getUriPath(manifestListLocation));
-
- // valid data files
- List<ManifestFile> manifestFiles =
snapshot.allManifests(internalTable.io());
- for (ManifestFile manifestFile : manifestFiles) {
- validFiles.add(TableFileUtil.getUriPath(manifestFile.path()));
- }
-
- LOG.info(
- "{} scan snapshot {}: {} and getRuntime {} files, complete {}/{}",
- tableName,
- snapshot.snapshotId(),
- formatTime(snapshot.timestampMillis()),
- validFiles.size() - before,
- cnt,
- size);
}
+ // valid data files
+ Set<String> allManifestFiles =
IcebergTableUtil.getAllManifestFiles(internalTable);
+ allManifestFiles.forEach(
+ f -> {
+ String path = TableFileUtil.getUriPath(f);
+ validFiles.add(path);
Review Comment:
```suggestion
validFiles.add(pathTableFileUtil.getUriPath(f));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]