[HUDI-3370] The files recorded in the commit may not match the actual ones for MOR Compaction (#4753)
* use HoodieCommitMetadata to replace writeStatuses computation Co-authored-by: yuezhang <yuezhang@freewheel.tv>
This commit is contained in:
@@ -35,10 +35,12 @@ import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* All the metadata that gets stored along with a commit.
|
||||
@@ -89,6 +91,10 @@ public class HoodieCommitMetadata implements Serializable {
|
||||
return partitionToWriteStats;
|
||||
}
|
||||
|
||||
public List<HoodieWriteStat> getWriteStats() {
|
||||
return partitionToWriteStats.values().stream().flatMap(Collection::stream).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public String getMetadata(String metaKey) {
|
||||
return extraMetadata.get(metaKey);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user