danny0405 commented on code in PR #10976:
URL: https://github.com/apache/hudi/pull/10976#discussion_r1578657154
##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieDefaultTimeline.java:
##########
@@ -540,10 +542,10 @@ private Option<HoodieInstant>
getLastOrFirstPendingClusterInstant(boolean isLast
@Override
public boolean isPendingClusterInstant(String instantTime) {
- HoodieTimeline potentialTimeline =
getCommitsTimeline().filterPendingReplaceTimeline().filter(i ->
i.getTimestamp().equals(instantTime));
- if (potentialTimeline.countInstants() == 0) {
+ if (!getOrCreatePendingReplaceInstantSet().contains(instantTime)) {
return false;
}
+ HoodieTimeline potentialTimeline =
getCommitsTimeline().filterPendingReplaceTimeline().filter(i ->
i.getTimestamp().equals(instantTime));
if (potentialTimeline.countInstants() > 1) {
throw new IllegalStateException("Multiple instants with same timestamp:
" + potentialTimeline);
Review Comment:
When multiple same instant time instant are on the timeline:
`potentialTimeline.countInstants() > 1`, this check is slow, let's improve it.
--
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]