[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [p2-dev] another m5 migration issue

Ciao Ian :)
Thanks for your response! :)
In 3.4 world I used to have a single Query and a special Collector that would post-process the query-results,
but now with 3.5 collectors seem to be used merely to collect these objects the query accepted. I therefor re-modeled
my collector to be another query, (not a match query but the newer breed) and tested things. In order to have both queries at the same time the compound query came in handy, so I used it right there (great concept by the way, thanks for that!). However, I don't seem to be able to use the compound now because all the queries in it seem to be executed twice, the second time with the subset of matches that made it through the first run.
From your answers below I'm not sure how to proceed, should I abandon the compound? Would have been nice to embrace it .. ;)
Another thing I'm wondering is if the same set of queries is executed twice, could it help to feed the second run the same information the first one got?
Ciao, hh
(I'm at EclipseCon, so if you had a minute I'd love to hear all about the story behind the compound vs. the collector..)

From: p2-dev-bounces@xxxxxxxxxxx [mailto:p2-dev-bounces@xxxxxxxxxxx] On Behalf Of Ian Bull
Sent: Thursday, March 19, 2009 9:53 PM
To: P2 developer discussions
Subject: Re: [p2-dev] another m5 migration issue

See below
I'm wondering why the queries are executed twice,the code in
CompoundQuery::query (~line 48) looks like this:
                       if (!isMatchQuery) {
                               // If it is not a MatchQuery then we
must query the results.
                               collector = results.query(query,
collector, subMonitor.newChild(10));
                       } ....

I'm pretty sure I'm doing something wrong, but running the same query
twice seems to be a performance issue if there is no good reason for it
anyway, so I might be on to something. Still, please feel free to
suggest alternative, more p2-friendly ways for achieving what I'm trying
to do.. :)
What you're talking about here is a CompoundQueryable.  That is, several queryables treated as a single unit. Think of this as Three Queryables(X, Y, Z), and you want to treat this as 1

In this case, lets say:
X: EMF 1.9 EMF 1.7
Y: EMF 2.0 EMF 1.4 EMF 1.3 EMF 1.2
Z:EMF 1.0 and EMF 3.0

In order to query the Latest version of EMF, you can't simply perform a LatestIU on each repo and hope that works.  You would get 3 answers.  The other option is to Select * from each repo and then perform the query on the results.  This would be bad if each repository contained lots of elements. The third way is to query each repo and then query the results.  This does not work in general, but it does work in all current p2 queries.

I have a general solution, but for simplicity we haven't included it. You can see it at [1]

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



Ciao, hh

p2-dev mailing list

R. Ian Bull | EclipseSource Victoria | +1 250 477 7484
http://eclipsesource.com | http://twitter.com/eclipsesource