[
https://issues.apache.org/jira/browse/FLINK-1694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14484992#comment-14484992
]
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_r27955499
--- Diff: docs/gelly_guide.md ---
@@ -343,29 +343,86 @@ Vertex-centric Iterations
Gelly wraps Flink's [Spargel API](spargel_guide.html) to provide methods
for vertex-centric iterations.
Like in Spargel, the user only needs to implement two functions: a
`VertexUpdateFunction`, which defines how a vertex will update its value
based on the received messages and a `MessagingFunction`, which allows a
vertex to send out messages for the next superstep.
-These functions are given as parameters to Gelly's
`createVertexCentricIteration`, which returns a `VertexCentricIteration`.
-The user can configure this iteration (set the name, the parallelism,
aggregators, etc.) and then run the computation, using the
`runVertexCentricIteration` method:
+These functions and the maximum number of iterations to run are given as
parameters to Gelly's `runVertexCentricIteration`.
+This method will execute the vertex-centric iteration on the input Graph
and return a new Graph, with updated vertex values:
{% highlight java %}
Graph<Long, Double, Double> graph = ...
-// create the vertex-centric iteration
-VertexCentricIteration<Long, Double, Double, Double> iteration =
- graph.createVertexCentricIteration(
+// run Single-Source-Shortest-Paths vertex-centric iteration
+Graph<Long, Double, Double> result =
+ graph.runVertexCentricIteration(
new VertexDistanceUpdater(), new
MinDistanceMessenger(), maxIterations);
+// user-defined functions
+public static final class VertexDistanceUpdater {...}
+public static final class MinDistanceMessenger {...}
+
+{% endhighlight %}
+
+### Configuring a Vertex-Centric Iteration
+A vertex-centric iteration can be configured using an
`IterationConfiguration` object.
+Currently, the following parameters can be specified:
+
+* <strong>Name</strong>: The name for the vertex-centric iteration. The
name is displayed in logs and messages
+and can be specified using the `setName()` method.
+
+* <strong>Parallelism</strong>: The parallelism for the iteration. It can
be set using the `setParallelism()` method.
+
+* <strong>Solution set in unmanaged memory</strong>: Defines whether the
solution set is kept in managed memory (Flink's internal way of keeping object
in serialized form) or as a simple object map. By default, the solution set
runs in managed memory. This property can be set using the
`setSolutionSetUnmanagedMemory()` method.
--- End diff --
Typo: "... of keeping objectS in ..."
> 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)