[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [p2-dev] @noimplement and @noextend annotation of IQuery
- From: John Arthorne <arthorne.eclipse@xxxxxxxxx>
- Date: Wed, 10 Mar 2010 14:25:46 -0500
- Delivered-to: firstname.lastname@example.org
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=Luz7RX0vD4RFCGdnk08S69UCfM9YpFS77bCm4E2It+ibdLZF4gJ6cr6zNs2FbHnPuC bfVgMXWRFrQx01abgmOQL33WUaP4ZtjG5NfeO+EEp7GKWkVzRaN4n+91PK0WwjTU2x1Z c4IYwJ1foMdAfnrHWWH0FOs41lQoPyKeaommQ=
These are the kinds of problems I was trying to describe in https://bugs.eclipse.org/bugs/show_bug.cgi?id=304130. We have made life much more complicated for these clients in order to solve a problem they don't have. Whether or not these queries can be written as _expression_-based queries isn't really the issue - the problem is that only Thomas seems to be able to write (and debug) non-trivial _expression_ queries and clients who don't have a Thomas on hand will end up having to iterate over an entire queryable anyway to manually collect up the matches they care about.
On Wed, Mar 10, 2010 at 3:03 AM, Thomas Hallgren <thomas@xxxxxxx>
You can use the function unique(). If given an argument that is a Set, that Set is used as the discriminator.
On 03/10/2010 06:36 AM, Meng Xin Zhu wrote:
A java service records some deselected IUs, the query should exclude
those IUs in that list.
Set<IInstallableUnit> recordedIUs = ...
Use a SimplePattern. A string like 'my.prefix.*' will match anything starting with 'my.prefix.'
Another simpler case is querying the IUs whose id starts with specified
QueryUtil.createMatchQuery("id ~= $0", SimplePattern.parse(prefix + '*'));
For more advanced cases that really cannot be resolved only by use of a query, there is often a benefit to start with a query anyway to benefit from indexing and then perform additional filtering as a next step:
HashSet<IInstallableUnit> collector = new HashSet<IInstallableUnit>();
Iterator<IInstallableUnit> iter = queriable.query(<inital query>, monitor).iterator();
IInstallableUnit iu = iter.next();
So far, we have seen very few cases where this has been necessary.