Hi Xingcan, On 7 February 2017 at 10:10, Xingcan Cui <xingc...@gmail.com> wrote:
> Hi all, > > I got some question about the vertex-centric iteration in Gelly. > > a) It seems the postSuperstep method is called before the superstep > barrier (I got different aggregate values of the same superstep in this > method). Is this a bug? Or the design is just like that? > The postSuperstep() method is called inside the close() method of a RichCoGroupFunction that wraps the ComputeFunction. The close() method It is called after the last call to the coGroup() after each iteration superstep. The aggregate values are not guaranteed to be consistent during the same superstep when they are computed. To retrieve an aggregate value for superstep i, you should use the getPreviousIterationAggregate() method in superstep i+1. > > b) There is not setHalt method for vertices. When no message received, a > vertex just quit the next iteration. Should I manually send messages (like > heartbeat) to keep the vertices active? > That's because vertex halting is implicitly controlled by the underlying delta iterations of Flink. A vertex will remain active as long as it receives a message or it updates its value, otherwise it will become inactive. The documentation on Gelly iterations [1] and DataSet iterations [2] might be helpful. > > c) I think we may need an initialization method in the ComputeFunction. > There exists a preSuperstep() method for initialization. This one will be executed once per superstep before the compute function is invoked for every vertex. Would this work for you? > > Any opinions? Thanks. > > Best, > Xingcan > > > I hope this helps, -Vasia. [1]: https://ci.apache.org/projects/flink/flink-docs-release-1.2/dev/libs/gelly/iterative_graph_processing.html#vertex-centric-iterations [2]: https://ci.apache.org/projects/flink/flink-docs-release-1.2/dev/batch/iterations.html