danny0405 commented on code in PR #10218:
URL: https://github.com/apache/hudi/pull/10218#discussion_r1410448274


##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/CompletionTimeQueryView.java:
##########
@@ -159,6 +166,50 @@ public Option<String> getCompletionTime(String startTime) {
       // the instant is still pending
       return Option.empty();
     }
+    loadCompletionTimeIncrementally(startTime);
+    return 
Option.ofNullable(this.startToCompletionInstantTimeMap.get(startTime));
+  }
+
+  /**
+   * Queries the instant start time with given completion time range.
+   *
+   * <p>By default, assumes there is at most 1 day time of duration for an 
instant to accelerate the queries.
+   *
+   * @param startCompletionTime The start completion time.
+   * @param endCompletionTime   The end completion time.
+   *
+   * @return The instant time set.
+   */
+  public Set<String> getStartTimeSet(String startCompletionTime, String 
endCompletionTime) {
+    // assumes any instant/transaction lasts at most 1 day to optimize the 
query efficiency.
+    return getStartTimeSet(startCompletionTime, endCompletionTime, s -> 
HoodieInstantTimeGenerator.instantTimeMinusMillis(s, MILLI_SECONDS_IN_ONE_DAY));
+  }
+
+  /**
+   * Queries the instant start time with given completion time range.
+   *
+   * @param startCompletionTime The start completion time.
+   * @param endCompletionTime   The end completion time.
+   *
+   * @return The instant time set.
+   */
+  public Set<String> getStartTimeSet(String startCompletionTime, String 
endCompletionTime, Function<String, String> earliestStartTimeFunc) {
+    String startInstant = earliestStartTimeFunc.apply(startCompletionTime);
+    final InstantRange instantRange = InstantRange.builder()
+        .rangeType(InstantRange.RangeType.CLOSE_CLOSE)

Review Comment:
   Maybe you can help with that, I introduced that years ago and I'm not very 
good at naming.



-- 
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]

Reply via email to