You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@giraph.apache.org by "Avery Ching (JIRA)" <ji...@apache.org> on 2012/07/01 08:01:44 UTC

[jira] [Commented] (GIRAPH-221) Make iteration over edges more explicit

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

Avery Ching commented on GIRAPH-221:
------------------------------------

+1

Alessandro, this looks great.  Did you run the unittests?  

I'm going to let this sit for around day in case anyone has an objection over the names.  Otherwise I'll commit tomorrow.  Thanks!
                
> Make iteration over edges more explicit
> ---------------------------------------
>
>                 Key: GIRAPH-221
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-221
>             Project: Giraph
>          Issue Type: Improvement
>          Components: graph
>            Reporter: Alessandro Presta
>            Assignee: Alessandro Presta
>            Priority: Minor
>         Attachments: GIRAPH-221-1.patch, GIRAPH-221-2.patch
>
>
> Is there any particular reason why BasicVertex implements Iterable?
> It seems to me that doing
> {code:java}
> for (I neighbor : vertex)
> {code}
> is not that explicit, and
> {code:java}
> for (I neighbor : this)
> {code}
> gets even obscure (which may be why all examples in the codebase explicitly instantiate an iterator and call next()).
> What I propose is a more explicit
> {code:java}
> Iterator<I> outEdgesIterator()
> {code}
> and also a convenient
> {code:java}
> Iterable<I> outEdges()
> {code}
> so, for example, an algorithm can use
> {code:java}
> for (IntWritable neighbor : outEdges())
> {code}

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