1
0

[HUDI-3406] Rollback incorrectly relying on FS listing instead of Com… (#4957)

* [HUDI-3406] Rollback incorrectly relying on FS listing instead of Commit Metadata

* [HUDI-3406] Rollback incorrectly relying on FS listing instead of Commit Metadata

* [HUDI-3406] Rollback incorrectly relying on FS listing instead of Commit Metadata

* fix comments

* fix comments

* fix comments
This commit is contained in:
ForwardXu
2022-04-01 10:01:41 +08:00
committed by GitHub
parent a048e940fd
commit 98b4e9796e
9 changed files with 351 additions and 368 deletions

View File

@@ -137,6 +137,19 @@ public class HoodieCommitMetadata implements Serializable {
return fullPaths;
}
public List<String> getFullPathsByPartitionPath(String basePath, String partitionPath) {
HashSet<String> fullPaths = new HashSet<>();
if (getPartitionToWriteStats().get(partitionPath) != null) {
for (HoodieWriteStat stat : getPartitionToWriteStats().get(partitionPath)) {
if ((stat.getFileId() != null)) {
String fullPath = FSUtils.getPartitionPath(basePath, stat.getPath()).toString();
fullPaths.add(fullPath);
}
}
}
return new ArrayList<>(fullPaths);
}
public Map<HoodieFileGroupId, String> getFileGroupIdAndFullPaths(String basePath) {
Map<HoodieFileGroupId, String> fileGroupIdToFullPaths = new HashMap<>();
for (Map.Entry<String, List<HoodieWriteStat>> entry : getPartitionToWriteStats().entrySet()) {