luoyuxia commented on code in PR #2326:
URL: https://github.com/apache/fluss/pull/2326#discussion_r2785449164


##########
fluss-common/src/main/java/org/apache/fluss/lake/committer/LakeCommitResult.java:
##########
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.fluss.lake.committer;
+
+import org.apache.fluss.annotation.PublicEvolving;
+import org.apache.fluss.metadata.TableBucket;
+
+import javax.annotation.Nullable;
+
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * The result of a lake commit operation, containing the committed snapshot ID 
and the readable
+ * snapshot information.
+ *
+ * <p>For most implementations, the readable snapshot is the same as the 
committed snapshot, and the
+ * readable log offsets are the same as the tiered offsets from 
TieringCommitOperator.
+ *
+ * <p>For Paimon DV tables, the readable snapshot will be different from the 
committed snapshot, and
+ * the log end offsets will be different as well (based on compaction status).
+ *
+ * @since 0.9
+ */
+@PublicEvolving
+public class LakeCommitResult {
+
+    // -1 to enforce to keep all previous snapshots
+    public static final Long KEEP_ALL_PREVIOUS = -1L;
+
+    // The snapshot ID that was just committed
+    private final long committedSnapshotId;
+
+    private final boolean committedIsReadable;
+
+    // The earliest snapshot ID to keep, null means not to keep any previous 
snapshot
+    @Nullable private final Long earliestSnapshotIDToKeep;
+
+    // the readable snapshot, null if
+    // 1: the readable snapshot is unknown,
+    // 2: committedIsReadable is true, committed snapshot is just also readable
+    @Nullable private final ReadableSnapshot readableSnapshot;
+
+    private LakeCommitResult(
+            long committedSnapshotId,
+            boolean committedIsReadable,
+            @Nullable ReadableSnapshot readableSnapshot,
+            @Nullable Long earliestSnapshotIDToKeep) {
+        this.committedSnapshotId = committedSnapshotId;
+        this.committedIsReadable = committedIsReadable;
+        this.readableSnapshot = readableSnapshot;
+        this.earliestSnapshotIDToKeep = earliestSnapshotIDToKeep;
+    }
+
+    public static LakeCommitResult committedIsReadable(long 
committedSnapshotId) {
+        return new LakeCommitResult(committedSnapshotId, true, null, null);

Review Comment:
   good suggestion



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