You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "schnappi17 (via GitHub)" <gi...@apache.org> on 2024/02/01 08:29:48 UTC

Re: [PR] [Core] Support branch batch/streaming read and write [incubator-paimon]

schnappi17 commented on code in PR #2748:
URL: https://github.com/apache/incubator-paimon/pull/2748#discussion_r1473997678


##########
paimon-core/src/main/java/org/apache/paimon/utils/SnapshotManager.java:
##########
@@ -367,26 +395,36 @@ public Snapshot traversalSnapshotsFromLatestSafely(Filter<Snapshot> checker) {
             }
         }
 
-        return findByListFiles(Math::max);
+        return findByListFiles(Math::max, branchName);
     }
 
-    private @Nullable Long findEarliest() throws IOException {
-        Path snapshotDir = snapshotDirectory();
+    private @Nullable Long findEarliest(String branchName) throws IOException {
+        Path snapshotDir =
+                branchName.equals(DEFAULT_MAIN_BRANCH)
+                        ? snapshotDirectory()
+                        : branchSnapshotDirectory(branchName);
         if (!fileIO.exists(snapshotDir)) {
             return null;
         }
 
-        Long snapshotId = readHint(EARLIEST);
+        Long snapshotId = readHint(EARLIEST, branchName);
         // null and it is the earliest only it exists
         if (snapshotId != null && snapshotExists(snapshotId)) {
             return snapshotId;
         }
 
-        return findByListFiles(Math::min);
+        return findByListFiles(Math::min, branchName);
     }
 
     public Long readHint(String fileName) {
-        Path snapshotDir = snapshotDirectory();
+        return readHint(fileName, DEFAULT_MAIN_BRANCH);
+    }
+
+    public Long readHint(String fileName, String branName) {

Review Comment:
   typo: branName -> branchName



-- 
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-unsubscribe@paimon.apache.org

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