yunfengzhou-hub commented on code in PR #7027:
URL: https://github.com/apache/paimon/pull/7027#discussion_r2850272412


##########
paimon-core/src/main/java/org/apache/paimon/operation/expire/DeletionReport.java:
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.paimon.operation.expire;
+
+import org.apache.paimon.data.BinaryRow;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/** Report of a single snapshot expiration task. */
+public class DeletionReport implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private final long snapshotId;
+
+    /** Whether this task was skipped (e.g., snapshot already deleted). */
+    private boolean skipped;
+
+    /** Whether data files were deleted. */
+    private boolean dataFilesDeleted;
+
+    /** Whether changelog data files were deleted. */
+    private boolean changelogDeleted;
+
+    /** Whether manifest files were deleted. */
+    private boolean manifestsDeleted;
+
+    /** Whether snapshot metadata file was deleted. */
+    private boolean snapshotDeleted;
+
+    /** Buckets that had files deleted (for empty directory cleanup in 
parallel phase). */
+    private Map<BinaryRow, Set<Integer>> deletionBuckets;
+
+    public DeletionReport(long snapshotId) {
+        this.snapshotId = snapshotId;
+        this.skipped = false;
+        this.dataFilesDeleted = false;
+        this.changelogDeleted = false;
+        this.manifestsDeleted = false;
+        this.snapshotDeleted = false;
+        this.deletionBuckets = new HashMap<>();
+    }
+
+    /**
+     * Create a skipped report for a snapshot that was already deleted.
+     *
+     * @param snapshotId the snapshot ID
+     * @return a skipped deletion report
+     */
+    public static DeletionReport skipped(long snapshotId) {
+        DeletionReport report = new DeletionReport(snapshotId);
+        report.skipped = true;
+        return report;
+    }
+
+    public long snapshotId() {
+        return snapshotId;
+    }
+
+    public boolean isSkipped() {
+        return skipped;
+    }
+
+    public void setDataFilesDeleted(boolean dataFilesDeleted) {
+        this.dataFilesDeleted = dataFilesDeleted;

Review Comment:
   Seems that these fields are only updated, but unused except in `toString` 
method.



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