pnowojski commented on a change in pull request #11098: [FLINK-16060][task] 
Implement working StreamMultipleInputProcessor
URL: https://github.com/apache/flink/pull/11098#discussion_r383385507
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java
 ##########
 @@ -637,19 +638,24 @@ public StreamNode getStreamNode(Integer vertexID) {
                return streamNodes.keySet();
        }
 
+       @VisibleForTesting
        public List<StreamEdge> getStreamEdges(int sourceId, int targetId) {
-
                List<StreamEdge> result = new ArrayList<>();
                for (StreamEdge edge : getStreamNode(sourceId).getOutEdges()) {
                        if (edge.getTargetId() == targetId) {
                                result.add(edge);
                        }
                }
+               return result;
+       }
 
+       @VisibleForTesting
+       @Deprecated
+       public List<StreamEdge> getStreamEdgesOrThrow(int sourceId, int 
targetId) {
 
 Review comment:
   Keep in mind that this method is only used in the tests, to make some 
assertions. 
   
   Generally speaking this old `getStreamEdges()` with throwing an exception 
was a bad & confusing design. It should never be like that. If it wasn't 
supposed to be empty, test should just assert manually content of the actual 
list, instead of relaying on this method throwing an exception. I tried to use 
it to actually make an assertion that the list is empty and it exploded in my 
face with some `RuntimeException`...
   
   If not for the fact that this method is used a lot in the tests and 
annoyingly, couple percent of those tests are actually relaying on the fact 
that this method throws, I would just drop it and use `getStreamEdges()` 
everywhere properly , but there were too many usages and I gave up...

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