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


##########
flink-runtime/src/main/java/org/apache/flink/runtime/state/filemerging/FileMergingOperatorStreamStateHandle.java:
##########
@@ -0,0 +1,154 @@
+/*
+ * 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.flink.runtime.state.filemerging;
+
+import org.apache.flink.runtime.state.CompositeStateHandle;
+import org.apache.flink.runtime.state.OperatorStreamStateHandle;
+import org.apache.flink.runtime.state.SharedStateRegistry;
+import org.apache.flink.runtime.state.SharedStateRegistryKey;
+import org.apache.flink.runtime.state.StreamStateHandle;
+import org.apache.flink.util.Preconditions;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * A {@link OperatorStreamStateHandle} that works for file merging checkpoints.
+ *
+ * <p>Operator states are stored in `taskownd/` dir when file merging is 
enabled. When an operator
+ * state dir is not referenced by any checkpoint, {@link SharedStateRegistry} 
will discard it. The
+ * shared subtask dir of fire merging is also tracked by {@link
+ * FileMergingOperatorStreamStateHandle}.
+ *
+ * <p>The shared subtask dir of file merging is created when task 
initialization, which will be
+ * discarded when no checkpoint refer to it.
+ */
+public class FileMergingOperatorStreamStateHandle extends 
OperatorStreamStateHandle
+        implements CompositeStateHandle {
+
+    private static final long serialVersionUID = 1L;
+    private static final Logger LOG =
+            
LoggerFactory.getLogger(FileMergingOperatorStreamStateHandle.class);
+
+    /** The directory handle of file merging under 'taskowed/', one for each 
job. */
+    private final DirectoryStreamStateHandle taskownedDirHandle;
+
+    /**
+     * The directory handle of file merging under 'shared/', one for each 
subtask.
+     *
+     * @see {@link 
org.apache.flink.runtime.checkpoint.filemerging.FileMergingSnapshotManager} for
+     *     the layout of file merging checkpoint directory.
+     */
+    private final DirectoryStreamStateHandle sharedDirHandle;
+
+    private transient SharedStateRegistry sharedStateRegistry;
+
+    public FileMergingOperatorStreamStateHandle(
+            DirectoryStreamStateHandle taskownedDirHandle,

Review Comment:
   How about name it `taskOwnedDirHandle`, I noticed variable names elsewhere 
are mostly `taskOwned` with a capital 'O'



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