[ 
https://issues.apache.org/jira/browse/GIRAPH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13396415#comment-13396415
 ] 

Jan van der Lugt commented on GIRAPH-192:
-----------------------------------------

Hi Jakob,

- The overwrite aggregator is only useful when using master.compute(). The 
master sets a value in the aggregator, overwriting the previous value (for 
example some global state the algorithm is in) and the workers read this value. 
I've changed the class description for these classes.
- I thought about having just long and double aggregators (with helper methods 
for settings ints and floats), but my conclusion is that when a user wants to 
depend on floats, for example to reproduce the results of an algorithm that 
uses floats, he should be able to. Of course it's usually better to use 
longs/doubles (especially when you are summing or calculating an average), but 
I did not want to make the choice for the user. I don't think it's a big 
problem to have them both and let the user decide, but if you think it's better 
to remove them, I'm ok with that.
- I thought about (and tried) making generic aggregators, but this is difficult 
for a few different reasons. Most importantly, the .get() method is not defined 
in Writable, only in for example LongWritable. There is no common 
superinterface for LongWritable, IntWritable, FloatWritable and DoubleWritable 
except for Writable, which is not usable because of the reason mentioned before.
- I will write the tests or file a JIRA for this once the shape and form of the 
aggregators ia agreed on, is that ok?
                
> Move aggregators to a seperate sub-package
> ------------------------------------------
>
>                 Key: GIRAPH-192
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-192
>             Project: Giraph
>          Issue Type: Improvement
>          Components: examples
>    Affects Versions: 0.2.0
>            Reporter: Jan van der Lugt
>            Assignee: Jan van der Lugt
>            Priority: Minor
>             Fix For: 0.2.0
>
>         Attachments: GIRAPH-192.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Since aggregators will be re-used throughout many projects and algorithms, it 
> makes sense to implement the most common ones in a separate sub-package. This 
> will reduce the time required for users when they implement their projects 
> based on Giraph, because the required aggregators are already in place. I 
> implemented the following ones:
> for int/long/float/double: min, max, product, sum, overwrite
> for boolean: and, or, overwrite
> Most of them speak for themselves, except for the overwrite one. This 
> aggregator simply overwrites the stored value when a new value is aggregated. 
> This is useful when one node is in some way a master node (for example a 
> source node in an routing algorithm), and this node wants to broadcast a 
> value to all other nodes.
> Attached is a patch against trunk implementing the aggregators and patching 
> some existing files so they use the .aggregators package instead of the 
> .examples one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to