[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Contract for compound queryables

On 03/17/2010 05:40 PM, Ian Bull wrote:
>From what I recall (this is a bit before my time), when the query mechanism was first introduced, it was decided that all query results (then called collectors) would collect things as Sets (unique).  Last year, I introduced the notion of List based collectors, but this was never used and I don't think our current infrastructure even supports it.

IMHO, this means we have gone back to what was originally decided, all queries should return a set, and thus compound things (like compound queryables) should return a unique set too.

Do others have thoughts on this?


The reason I'm concerned is that I want to avoid the rather serious performance hit implied by such a contract. A query on a compound queryable must then first bring everything into memory and then deliver an iterator over the unique set to the actual query.

The alternative is to ask the IQueryResult for a set using the toUnmodifiableSet() or toSet() method. If the query result already used a set internally, that operation is free of charge. If not, well, then it has just the matches to consider when building the unique set.

The only time that you would encounter duplicates is probably when you query for all elements and then use the iterator directly.

- thomas



cheers,
ian

On Tue, Mar 16, 2010 at 9:46 AM, Thomas Hallgren <thomas@xxxxxxx> wrote:
Hi,
Is it required for a CompoundQueryable to return a unique set when queried for all elements?

- thomas

_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev



--
R. Ian Bull | EclipseSource Victoria | +1 250 477 7484
http://eclipsesource.com | http://twitter.com/eclipsesource
_______________________________________________ p2-dev mailing list p2-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/p2-dev