[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[p2-dev] Compound Queryables

A few more changes have been released for the Query API.  In particular, I have added a CompoundQueryable.  This is an abstraction that allows you, (those who implement queryables) to query a bunch of queryables at once. Composite repositories are the classic example of this.

This existed before, however, it was not centralized and it did not work in all cases.  There are a few sublties that you have to consider when querying multiple things.  For example, you cannot just call query on each repo and hope to get the answer:

(Consider getLatestIU. If you ran this on 5 repos, you would get 5 latest IUs). The CompoundQueryable takes care of this.

There is one problem that I uncovered that I did not solve, queries that are not non-transitive.  If a query depends on the order it runs -- when run across multiple repos -- then you won't necessarily get the correct answer.  Consider the query that says: get me the second greatest IU. This cannot be computed by calling SecondGreatestIU on each repo, and then SecondGreatestIU on the results.

I have created a patch that fixes this [1] (by allowing queries to specify advice on how they should run in a compound case).  But I'm not sure if we should release this or not.

Pros: It fixes things so that queries run in all cases.  If someone creates a non-transitive query, they may not get the correct results and debugging this will be hell.

Cons:  We don't currently have any of these queries in p2.  This adds more complexity to the query API.

Does anyone have thoughts.
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=261758

--
R. Ian Bull, PhD
Software Developer, EclipseSource
http://www.ianbull.com
http://blog.ianbull.com