Encounter order

Paul Sandoz paul.sandoz at oracle.com
Mon Oct 29 03:04:53 PDT 2012


On Oct 25, 2012, at 6:00 PM, Brian Goetz <brian.goetz at Oracle.COM> wrote:
> 
> Given this, my recommendation is:
> - Have all the problematic (sort, uniqueElements, groupBy, reduceBy) ops respect encounter order even though it may be expensive
> - Provide an .unordered() op for people to opt out of the encounter order when they know they don't care.
> - Impute encounter order if we need one and there isn't one (rather than throwing)
> 

+1 

Thinking positively we might even be able to find/develop sufficiently optimized implementations over time (even if they are never as fast as non-order-preserving implementations).

So it may be sufficient right now for uniqueElements() if each leaf has a LinkedHashSet and the merge/combine adds the right hand set to the left hand set, and the latter pushes up to the parent (similar to of how groupBy is currently implemented). Then we go searching/thinking about parallel map merge/combine algorithms...

Paul.





More information about the lambda-libs-spec-observers mailing list