Github user kl0u commented on a diff in the pull request:
https://github.com/apache/flink/pull/3484#discussion_r106138473
--- Diff:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/SingleOutputStreamOperator.java
---
@@ -416,4 +428,26 @@ private boolean canBeParallel() {
transformation.setSlotSharingGroup(slotSharingGroup);
return this;
}
+
+ /**
+ * Gets the {@link DataStream} that contains the elements that are
emitted from an operation
+ * into the side output with the given {@link OutputTag}.
+ *
+ * @see
org.apache.flink.streaming.api.functions.ProcessFunction.Context#output(OutputTag,
Object)
+ */
+ public <X> DataStream<X> getSideOutput(OutputTag<X> sideOutputTag){
+ sideOutputTag = clean(sideOutputTag);
+
+ TypeInformation<?> type =
requestedSideOutputs.get(sideOutputTag);
+ if (type != null && !type.equals(sideOutputTag.getTypeInfo())) {
+ throw new UnsupportedOperationException("A side output
with a matching id was " +
+ "already requested with a different
type. This is not allowed, side output " +
+ "ids need to be unique.");
+ }
+
+ requestedSideOutputs.put(sideOutputTag,
sideOutputTag.getTypeInfo());
+
--- End diff --
The `requireNotNull` should be in the beginning of the method.
---
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.
---