You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "jiangxin369 (via GitHub)" <gi...@apache.org> on 2023/04/25 03:32:23 UTC

[GitHub] [flink-ml] jiangxin369 commented on a diff in pull request #234: [FLINK-31887] Upgrade Flink version of Flink ML to 1.16.1

jiangxin369 commented on code in PR #234:
URL: https://github.com/apache/flink-ml/pull/234#discussion_r1175973954


##########
flink-ml-iteration/src/main/java/org/apache/flink/iteration/operator/OperatorUtils.java:
##########
@@ -136,31 +135,20 @@ public static StreamConfig createWrappedOperatorConfig(StreamConfig config, Clas
         wrappedConfig.setTypeSerializerOut(
                 ((IterationRecordSerializer<?>) typeSerializerOut).getInnerSerializer());
 
-        Stream.concat(
-                        config.getChainedOutputs(cl).stream(),
-                        config.getNonChainedOutputs(cl).stream())
+        config.getChainedOutputs(cl)
                 .forEach(
-                        edge -> {
-                            OutputTag<?> outputTag = edge.getOutputTag();
-                            if (outputTag != null) {
-                                TypeSerializer<?> typeSerializerSideOut =
-                                        config.getTypeSerializerSideOut(outputTag, cl);
-                                checkState(
-                                        typeSerializerSideOut instanceof IterationRecordSerializer,
-                                        "The serializer of side output with tag[%s] should be IterationRecordSerializer but it is %s.",
-                                        outputTag,
-                                        typeSerializerSideOut);
-                                wrappedConfig.setTypeSerializerSideOut(
-                                        new OutputTag<>(
-                                                outputTag.getId(),
-                                                ((IterationRecordTypeInfo<?>)
-                                                                outputTag.getTypeInfo())
-                                                        .getInnerTypeInfo()),
-                                        ((IterationRecordSerializer) typeSerializerSideOut)
-                                                .getInnerSerializer());
-                            }
+                        chainedOutput -> {
+                            OutputTag<?> outputTag = chainedOutput.getOutputTag();
+                            setTypeSerializerSideOut(outputTag, config, wrappedConfig, cl);
+                        });
+        config.getOperatorNonChainedOutputs(cl)

Review Comment:
   The reason why I separate these two parts is `config.getChainedOutputs(cl)` returns `List<StreamEdge>` while `config.getOperatorNonChainedOutputs(cl)` returns `List<NonChainedOutput>`, they are of different types and are not suitable to iterate in the same loop.



-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org