PavithranRick commented on code in PR #14261:
URL: https://github.com/apache/hudi/pull/14261#discussion_r2579199727
##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/ArchivedTimelineLoader.java:
##########
@@ -45,4 +45,25 @@ void loadInstants(
HoodieArchivedTimeline.LoadMode loadMode,
Function<GenericRecord, Boolean> commitsFilter,
BiConsumer<String, GenericRecord> recordConsumer);
+
+ /**
+ * Loads the instants from the timeline with optional limit for early
termination.
+ *
+ * @param metaClient The meta client.
+ * @param filter The time range filter where the target instant
belongs to.
+ * @param loadMode The load mode.
+ * @param commitsFilter Filter of the instant type.
+ * @param recordConsumer Consumer of the instant record payload.
+ * @param limit Maximum number of instants to load. Use -1 for no
limit.
Review Comment:
done
##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/versioning/v1/ArchivedTimelineLoaderV1.java:
##########
@@ -100,6 +119,9 @@ public void loadInstants(HoodieTableMetaClient metaClient,
int instantsInPreviousFile = instantsInRange.size();
// Read the avro blocks
while (reader.hasNext()) {
+ if (hasLimit && loadedCount.get() >= limit) {
Review Comment:
done
--
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]