I don't think its possible to access. What I've done before is send the
current or next iteration index with the message, where the message is a
case class.

HTH
Dan

On Tue, Feb 3, 2015 at 10:20 AM, Matthew Cornell <corn...@cs.umass.edu>
wrote:

> Hi Folks,
>
> I'm new to GraphX and Scala and my sendMsg function needs to index into an
> input list to my algorithm based on the pregel()() iteration number, but I
> don't see a way to access that. I see in
> https://github.com/apache/spark/blob/master/graphx/src/main/scala/org/apache/spark/graphx/Pregel.scala
> that it's just an index variable "i" in a while loop, but is there a way
> for sendMsg to access within the loop's scope? I don't think so, so barring
> that, given Scala's functional stateless nature, what other approaches
> would you take to do this? I'm considering a closure, but a var that gets
> updated by all the sendMsgs seems a recipe for trouble.
>
> Thank you,
>
> matt
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
> For additional commands, e-mail: user-h...@spark.apache.org
>
>

Reply via email to