JingsongLi commented on a change in pull request #8295: [FLINK-11974][runtime] 
Introduce StreamOperatorFactory
URL: https://github.com/apache/flink/pull/8295#discussion_r279175759
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java
 ##########
 @@ -480,13 +483,17 @@ private StreamGraph 
generateInternal(List<StreamTransformation<?>> transformatio
                streamGraph.addSource(source.getId(),
                                slotSharingGroup,
                                source.getCoLocationGroupKey(),
-                               source.getOperator(),
+                               source.getOperatorFactory(),
                                null,
                                source.getOutputType(),
                                "Source: " + source.getName());
-               if (source.getOperator().getUserFunction() instanceof 
InputFormatSourceFunction) {
-                       InputFormatSourceFunction<T> fs = 
(InputFormatSourceFunction<T>) source.getOperator().getUserFunction();
-                       streamGraph.setInputFormat(source.getId(), 
fs.getFormat());
+               if (source.getOperatorFactory() instanceof 
SimpleOperatorFactory) {
+                       SimpleOperatorFactory<T> factory = 
(SimpleOperatorFactory<T>) source.getOperatorFactory();
+                       Function userFunction = ((StreamSource) 
factory.getOperator()).getUserFunction();
+                       if (userFunction instanceof InputFormatSourceFunction) {
+                               InputFormatSourceFunction<T> fs = 
(InputFormatSourceFunction<T>) userFunction;
+                               streamGraph.setInputFormat(source.getId(), 
fs.getFormat());
 
 Review comment:
   Here need get input format, not exposing this capability to 
StreamOperatorFactory

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to