[ 
https://issues.apache.org/jira/browse/FLINK-1694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14484995#comment-14484995
 ] 

ASF GitHub Bot commented on FLINK-1694:
---------------------------------------

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

    https://github.com/apache/flink/pull/547#discussion_r27955651
  
    --- Diff: 
flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java ---
    @@ -1118,30 +1119,52 @@ public boolean filter(Edge<K, EV> edge) {
        }
     
        /**
    -    * Create a Vertex-Centric iteration on the graph.
    -    * 
    +    * Runs a Vertex-Centric iteration on the graph.
    +    * No configuration options are provided.
    +
         * @param vertexUpdateFunction the vertex update function
         * @param messagingFunction the messaging function
         * @param maximumNumberOfIterations maximum number of iterations to 
perform
    -    * @return
    +    * 
    +    * @return the updated Graph after the vertex-centric iteration has 
converged or
    +    * after maximumNumberOfIterations.
         */
    -   public <M> VertexCentricIteration<K, VV, M, EV> 
createVertexCentricIteration(
    +   public <M> Graph<K, VV, EV> runVertexCentricIteration(
                        VertexUpdateFunction<K, VV, M> vertexUpdateFunction,
                        MessagingFunction<K, VV, M, EV> messagingFunction,
                        int maximumNumberOfIterations) {
    -           return VertexCentricIteration.withEdges(edges, 
vertexUpdateFunction,
    -                           messagingFunction, maximumNumberOfIterations);
    +
    --- End diff --
    
    Function call could be forwarded to the configured 
`runVertexCentricIteration` to reduce code duplication.


> Change the split between create/run of a vertex-centric iteration
> -----------------------------------------------------------------
>
>                 Key: FLINK-1694
>                 URL: https://issues.apache.org/jira/browse/FLINK-1694
>             Project: Flink
>          Issue Type: Improvement
>          Components: Gelly
>            Reporter: Vasia Kalavri
>            Assignee: Vasia Kalavri
>
> Currently, the vertex-centric API in Gelly looks like this:
> {code:java}
> Graph inputGaph = ... //create graph
> VertexCentricIteration iteration = inputGraph.createVertexCentricIteration();
> ... // configure the iteration
> Graph newGraph = inputGaph.runVertexCentricIteration(iteration);
> {code}
> We have this create/run split, in order to expose the iteration object and be 
> able to call the public methods of VertexCentricIteration.
> However, this is not very nice and might lead to errors, if create and run 
> are  mistakenly called on different graph objects.
> One suggestion is to change this to the following:
> {code:java}
> VertexCentricIteration iteration = inputGraph.createVertexCentricIteration();
> ... // configure the iteration
> Graph newGraph = iteration.result();
> {code}
> or to go with a single run call, where we add an IterationConfiguration 
> object as a parameter and we don't expose the iteration object to the user at 
> all:
> {code:java}
> IterationConfiguration parameters  = ...
> Graph newGraph = inputGraph.runVertexCentricIteration(parameters);
> {code}
> and we can also have a simplified method where no configuration is passed.
> What do you think?
> Personally, I like the second option a bit more.
> -Vasia.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to