Github user kl0u commented on a diff in the pull request:
https://github.com/apache/flink/pull/3484#discussion_r105398836
--- Diff:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java
---
@@ -300,6 +303,36 @@ private StreamGraph
generateInternal(List<StreamTransformation<?>> transformatio
}
/**
+ * Transforms a {@code SideOutputTransformation}.
+ *
+ * <p>
+ * For this we create a virtual node in the {@code StreamGraph} that
holds the side-output
+ * {@link org.apache.flink.util.OutputTag}.
+ *
+ * @see org.apache.flink.streaming.api.graph.StreamGraphGenerator
+ */
+ private <T> Collection<Integer>
transformSideOutput(SideOutputTransformation<T> sideOutput) {
+ StreamTransformation<T> input = sideOutput.getInput();
+ Collection<Integer> resultIds = transform(input);
+
+
+ // the recursive transform might have already transformed this
+ if (alreadyTransformed.containsKey(sideOutput)) {
+ return alreadyTransformed.get(sideOutput);
+ }
+
+ List<Integer> virtualResultIds = new ArrayList<>();
+
+ for (int inputId : resultIds) {
+ int virtualId = StreamTransformation.getNewNodeId();
+ streamGraph.addVirtualSideOutputNode(inputId,
virtualId, sideOutput.getOutputTag());
+ virtualResultIds.add(virtualId);
+ }
+ return virtualResultIds;
+ }
+
+
--- End diff --
Leave only one empty line.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---