-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3287/#review4036
-----------------------------------------------------------

Ship it!


I ran into the same issue yesterday and the solution presented here is correct. 
For reasons of efficiency, list.elements() returns the internal underlying 
array for the list, which might be bigger than the number of elements stored in 
the list. Therefore you should only iterate until list.size() or use the 
foreachKey() callback.

- Sebastian


On 2011-12-21 07:50:20, Avery Ching wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/3287/
> -----------------------------------------------------------
> 
> (Updated 2011-12-21 07:50:20)
> 
> 
> Review request for giraph.
> 
> 
> Summary
> -------
> 
> As pointed out by YuanYua, the array returned by elements() cannot have its 
> length used since the array contains all the elements currently stored in the 
> mahout collections, even including invalid elements between size and capacity.
> 
> Whenever possible I converted elements() into forEach(), forEachKey(), 
> forEachPair().  Used size() in other cases.
> 
> Fixed some formatting violations as well in LongDoubleFloatDoubleVertex.java.
> 
> 
> This addresses bug GIRAPH-112.
>     https://issues.apache.org/jira/browse/GIRAPH-112
> 
> 
> Diffs
> -----
> 
>   
> http://svn.apache.org/repos/asf/incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/LongDoubleFloatDoubleVertex.java
>  1221634 
> 
> Diff: https://reviews.apache.org/r/3287/diff
> 
> 
> Testing
> -------
> 
> Local unittests and MR unittests.
> 
> 
> Thanks,
> 
> Avery
> 
>

Reply via email to