You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@giraph.apache.org by Puneet Agarwal <pu...@yahoo.com> on 2014/10/06 20:46:06 UTC

Re: getAggregatedValue calling aggregate

Dear Mathew,
Pardon the late reply.
In my work, every vertex will have a score, I want to find the top-K scoring vertexes.I planned to use an aggregator for this, here, I store my aggregated value as Text, which stores the top-K vertex-id and their scores.
By the way, I have solved my problem in the following manner.
In the aggregate function now, I check for all such conditions, for example whether the same value is being passed, if yes, I would suitably handle the situation.But I found it counter intuitive and hard to manage many possible situations like this.
Thanks for help anyway, it has worked now.
RegardsPuneet
 

     On Tuesday, September 23, 2014 2:53 PM, Matthew Saltz <sa...@gmail.com> wrote:
   

 HI Puneet,
What are you trying to do in getAggregatedValue()? Is there any reason you don't just want to return the current value of the aggregator (which is what the default implementation does)?
Best,Matthew
On Sat, Sep 20, 2014 at 6:25 AM, Puneet Agarwal <pu...@yahoo.com> wrote:

I have created my own aggregator, by extending the BasicAggregator.
In this aggregator I have overridden following methods
aggregate()createInitialValue()getAggregatedValue()
(The documentation says that we need to implement aggregate and createInitialValue methods only, if so, how and what will it return when getAggregatedValue() is called?)
My main problems are:
a. When I call the method getAggregatedValue() from the compute method of my vertex class, nothing gets returnedb. When I call the method getAggregatedValue() from the compute method of my vertex class, aggregate() method of the aggregator class is getting called and it received the value returned by the method getAggregatedValue().
am I missing something very basic here?
Please Help
Puneet AgarwalIIT Delhi