Uploaded image for project: 'Giraph (Retired)'
  1. Giraph (Retired)
  2. GIRAPH-221

Make iteration over edges more explicit

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • graph
    • None

    Description

      Is there any particular reason why BasicVertex implements Iterable?

      It seems to me that doing

      for (I neighbor : vertex)
      

      is not that explicit, and

      for (I neighbor : this)
      

      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

      Iterator<I> outEdgesIterator()
      

      and also a convenient

      Iterable<I> outEdges()
      

      so, for example, an algorithm can use

      for (IntWritable neighbor : outEdges())
      

      Attachments

        1. GIRAPH-221-2.patch
          23 kB
          Alessandro Presta
        2. GIRAPH-221-1.patch
          23 kB
          Alessandro Presta

        Issue Links

          Activity

            People

              apresta Alessandro Presta
              apresta Alessandro Presta
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: