yihua commented on code in PR #5052:
URL: https://github.com/apache/hudi/pull/5052#discussion_r973541666
##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/AbstractHoodieLogRecordReader.java:
##########
@@ -361,6 +366,19 @@ protected synchronized void scanInternal(Option<KeySpec>
keySpecOpt) {
}
}
+ /**
+ * Check whether the current instants are valid
+ *
+ * @param instantTime
+ * @return
+ */
+ private boolean checkIfValidCommit(String instantTime) {
+ HoodieTimeline deltaCommitTimeline =
this.hoodieTableMetaClient.getActiveTimeline().getDeltaCommitTimeline().filterCompletedInstants();
+ return deltaCommitTimeline.containsInstant(instantTime)
+ || (deltaCommitTimeline.isBeforeTimelineStarts(instantTime)
+ &&
this.hoodieTableMetaClient.getArchivedTimeline().getDeltaCommitTimeline().filterCompletedInstants().containsOrBeforeTimelineStarts(instantTime));
Review Comment:
`getArchivedTimeline()` loads all instants in the archived timeline by
deserializing the commit metadata stored in Avro, which is time-consuming. Can
you avoid calling that if possible?
--
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]