fredia commented on code in PR #24513:
URL: https://github.com/apache/flink/pull/24513#discussion_r1535337848


##########
flink-runtime/src/main/java/org/apache/flink/runtime/state/filemerging/SegmentFileStateHandle.java:
##########
@@ -62,19 +77,58 @@ public class SegmentFileStateHandle implements 
StreamStateHandle {
      * @param scope The state's scope, whether it is exclusive or shared.
      */
     public SegmentFileStateHandle(
-            Path filePath, long startPos, long stateSize, 
CheckpointedStateScope scope) {
+            Path directoryPath,
+            Path filePath,
+            long startPos,
+            long stateSize,
+            CheckpointedStateScope scope) {
         this.filePath = filePath;
         this.stateSize = stateSize;
         this.startPos = startPos;
         this.scope = scope;
+        this.directoryStateHandle =
+                DirectoryStreamStateHandle.forPathWithSize(
+                        new File(directoryPath.getPath()).toPath());

Review Comment:
   👍, I've stored the `DirectoryStreamStateHandle` of each subtask in 
`FileMergingSnapshotManager`. Now, they are only created once when job start.



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