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


##########
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:
   @JingsongLi, would the snapshot be archived? If the snapshot is archived, 
the earliest snapshot may not be read.



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