incubator-hama-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward J. Yoon (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HAMA-518) Add MinIntCombiner to SSSP example
Date Thu, 08 Mar 2012 04:37:01 GMT

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

Edward J. Yoon commented on HAMA-518:
-------------------------------------

Test passed on my cluster. I'm going to commit tonight.
                
> Add MinIntCombiner to SSSP example
> ----------------------------------
>
>                 Key: HAMA-518
>                 URL: https://issues.apache.org/jira/browse/HAMA-518
>             Project: Hama
>          Issue Type: New Feature
>          Components: examples, graph
>    Affects Versions: 0.4.0
>            Reporter: Edward J. Yoon
>            Assignee: Edward J. Yoon
>             Fix For: 0.5.0
>
>         Attachments: Combiner.patch
>
>
> If we able to use BSP's combiner function, MinIntCombiner can be implemented like this:
> {code}
>   public static class MinIntCombiner extends Combiner<IntWritable> {
>     @Override
>     public BSPMessageBundle<IntWritable> combine(Iterable<IntWritable> messages)
{
>       BSPMessageBundle<IntWritable> bundle = new BSPMessageBundle<IntWritable>();
>       int minDist = Integer.MAX_VALUE;
>       Iterator<IntWritable> it = messages.iterator();
>       while (it.hasNext()) {
>          int msgValue = it.next().get();
>          if(minDIst > msgValue)
>            minDist = msgValue;
>       }
>       bundle.addMessage(new IntWritable(minDist));
>       return bundle;
>     }
>   }
> {code}
> By the way, unfortunately, MapWritable was used to send destination VertexID together.
> {code}
>         for (Entry<Writable, Writable> e : msg.entrySet()) {
>           String vertexID = ((Text) e.getKey()).toString();
>           Writable value = e.getValue();
> {code}
> Should we implement Graph's own Combiners? or use anyhow BSP's combiner function?

--
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

        

Mime
View raw message