Zakelly commented on code in PR #24762:
URL: https://github.com/apache/flink/pull/24762#discussion_r1599318520


##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/filemerging/PhysicalFile.java:
##########
@@ -88,18 +88,34 @@ PhysicalFile perform(
      */
     private boolean deleted = false;
 
+    /**
+     * If a physical file is owned by current {@link 
FileMergingSnapshotManager}, the current {@link
+     * FileMergingSnapshotManager} should not delete or count it if not owned.
+     */
+    private boolean isOwned;
+
     public PhysicalFile(
             @Nullable FSDataOutputStream outputStream,
             Path filePath,
             @Nullable PhysicalFileDeleter deleter,
             CheckpointedStateScope scope) {
+        this(outputStream, filePath, deleter, scope, true);
+    }
+
+    public PhysicalFile(
+            @Nullable FSDataOutputStream outputStream,
+            Path filePath,
+            @Nullable PhysicalFileDeleter deleter,
+            CheckpointedStateScope scope,
+            boolean owned) {
         this.filePath = filePath;
         this.outputStream = outputStream;
         this.closed = outputStream == null;
-        this.deleter = deleter;
+        this.deleter = owned ? deleter : null;

Review Comment:
   ```suggestion
           this.deleter = deleter;
   ```
   
   I'd suggest keep this simple.



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