zjureel commented on code in PR #388:
URL: https://github.com/apache/flink-table-store/pull/388#discussion_r1026103960


##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/utils/SnapshotManager.java:
##########
@@ -90,6 +90,22 @@ public boolean snapshotExists(long snapshotId) {
         }
     }
 
+    public @Nullable Long earlierThanTimeMills(long timestampMills) {
+        Long earliest = earliestSnapshotId();
+        Long latest = latestSnapshotId();
+        if (earliest == null || latest == null) {
+            return null;
+        }
+
+        for (long i = latest; i >= earliest; i--) {
+            long commitTime = snapshot(i).timeMillis();
+            if (commitTime < timestampMills) {
+                return i;
+            }
+        }
+        return earliest - 1;

Review Comment:
   Nice, we can doc it, otherwise it may cause misunderstanding by other ones



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to