I understand, but I believe that concurrency should actually not be an issue. Inside each jvm/mapper only one vertex is being computed at a time, so you could definitely use a static field without concurrency classes.
On Fri, Jun 22, 2012 at 2:54 PM, Gianmarco De Francisci Morales <g...@apache.org> wrote: > Yes, I had thought of a static field, but I didn't want to manage > concurrency. > As a workaround I think it would be the best option. > Though providing an idiom to perform this task in Giraph would be good to > simplify the life of users. > I will file a Jira proposing to pass the configuration to the WorkerContext. > > Cheers, > -- > Gianmarco > > > > > On Thu, Jun 21, 2012 at 11:53 PM, Claudio Martella < > claudio.marte...@gmail.com> wrote: > >> On Thu, Jun 21, 2012 at 10:24 PM, Gianmarco De Francisci Morales >> <g...@apache.org> wrote: >> > Hi, >> > >> > I was wondering which is the best place for parameters passed to >> algorithms. >> > I am referring to parameters that are the same for all the vertexes and >> > need to be accessed at runtime (e.g. max num of supersteps). >> > >> > One way is to read them from the conf in the first superstep and save >> them >> > in memory in the vertex. >> > However this solution is wasteful in terms of memory, as it replicates >> the >> > same value multiple times. >> >> What about a static field? you could use something from the concurrent >> package, if concurrency is your issue. >> >> > >> > Another solution is to read them from the conf every time, but this >> > requires reparsing them each time. >> > >> > The WorkerContext looks the right place to put this kind of data. >> > However there is no way (I know of) to access the configuration from the >> > WorkerContext. >> > Am I correct? >> > >> > Would it be difficult to implement this change? >> > Are there reasons why it is not in place already? >> > >> > Cheers, >> > -- >> > Gianmarco >> >> >> >> -- >> Claudio Martella >> claudio.marte...@gmail.com >> -- Claudio Martella claudio.marte...@gmail.com