Github user vasia commented on a diff in the pull request:

    https://github.com/apache/flink/pull/818#discussion_r32374715
  
    --- Diff: 
flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java ---
    @@ -1234,6 +1234,18 @@ public void coGroup(Iterable<Edge<K, EV>> edge, 
Iterable<Edge<K, EV>> edgeToBeRe
        }
     
        /**
    +    * Performs Difference on the vertex and edge sets of the input graphs
    +    * removes common vertices and edges. If a source/target vertex is 
removed, its corresponding edge will also be removed
    +    * @param graph the graph to perform difference with
    +    * @return a new graph where the common vertices and edges have been 
removed
    +    */
    +   public Graph<K,VV,EV> difference(Graph<K,VV,EV> graph) throws 
java.lang.Exception{
    +           DataSet<Vertex<K,VV>> removeVerticesData = graph.getVertices();
    +           final List<Vertex<K,VV>> removeVerticesList = 
removeVerticesData.collect();
    --- End diff --
    
    I don't think we should use `collect()` here.. Keep in mind that (1) 
`collect()` will trigger program execution and (2) should not be used to 
collect large DataSets and input graph might have lots of vertices.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to