yihua commented on code in PR #11947:
URL: https://github.com/apache/hudi/pull/11947#discussion_r1802125468
##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieDefaultTimeline.java:
##########
@@ -629,16 +649,23 @@ private Set<String>
getOrCreatePendingClusteringInstantSet() {
/**
* Returns the first non savepoint commit on the timeline.
*/
- private static Option<HoodieInstant>
findFirstNonSavepointCommit(List<HoodieInstant> instants) {
+ private static Option<HoodieInstant> findFirstNonSavepointCommit(
+ List<HoodieInstant> instants,
+ boolean byCompletionTime) {
Set<String> savepointTimestamps = instants.stream()
.filter(entry ->
entry.getAction().equals(HoodieTimeline.SAVEPOINT_ACTION))
- .map(HoodieInstant::getTimestamp)
+ .map(byCompletionTime
+ ? HoodieInstant::getCompletionTime
+ : HoodieInstant::getTimestamp)
.collect(Collectors.toSet());
if (!savepointTimestamps.isEmpty()) {
// There are chances that there could be holes in the timeline due to
archival and savepoint interplay.
// So, the first non-savepoint commit is considered as beginning of the
active timeline.
return Option.fromJavaOptional(instants.stream()
- .filter(entry -> !savepointTimestamps.contains(entry.getTimestamp()))
+ .filter(entry -> !savepointTimestamps.contains(
Review Comment:
Fixed.
--
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]