noorall commented on code in PR #25366:
URL: https://github.com/apache/flink/pull/25366#discussion_r1798302712


##########
flink-runtime/src/main/java/org/apache/flink/streaming/api/graph/util/OperatorChainInfo.java:
##########
@@ -0,0 +1,194 @@
+/*
+ * 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.streaming.api.graph.util;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.api.common.operators.ResourceSpec;
+import org.apache.flink.runtime.jobgraph.InputOutputFormatContainer;
+import org.apache.flink.runtime.jobgraph.OperatorID;
+import org.apache.flink.runtime.operators.coordination.OperatorCoordinator;
+import org.apache.flink.streaming.api.graph.StreamEdge;
+import org.apache.flink.streaming.api.graph.StreamGraph;
+import org.apache.flink.streaming.api.graph.StreamNode;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/** Helper class to help maintain the information of an operator chain. */
+@Internal
+public class OperatorChainInfo {
+    private final Integer startNodeId;
+    private final Map<Integer, byte[]> hashes;
+    private final List<Map<Integer, byte[]>> legacyHashes;
+    private final Map<Integer, List<ChainedOperatorHashInfo>> 
chainedOperatorHashes;
+    private final Map<Integer, ChainedSourceInfo> chainedSources;
+    private final Map<Integer, ResourceSpec> chainedMinResources;
+    private final Map<Integer, ResourceSpec> chainedPreferredResources;
+    private final Map<Integer, String> chainedNames;
+    private final List<OperatorCoordinator.Provider> coordinatorProviders;
+    private final StreamGraph streamGraph;

Review Comment:
   > Looks to me these fields can be globally shared: streamGraph, hashes, 
legacyHashes, chainedOperatorHashes, chainedSources, chainedMinResources, 
chainedPreferredResources, chainedNames? How about to put them into the build 
context, providing necessary getters&setters, and just pass the context 
directly to `OperatorChainInfo`? Maybe we can have a simpler 
`OperatorChainInfo`?
   > 
   > Moreover, if we do it in that way, would it work if we let the generator 
call `context#getHash()` instead of `chainInfo#getHash()`?
   
   Only streamGraph, hashes, and legacyHashes are globally shared, while the 
other fields are used only within their respective chains. I think we can move 
the globally shared fields to the context, while keeping the remaining fields 
in chainInfo.



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