Bug 256434 - [repo] Consider a query mechanism on artifact repositories
Summary: [repo] Consider a query mechanism on artifact repositories
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Andrew Niefer CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2008-11-25 08:43 EST by Pascal Rapicault CLA
Modified: 2010-03-04 16:11 EST (History)
3 users (show)

See Also:


Attachments
patch (27.07 KB, patch)
2009-11-04 15:42 EST, Andrew Niefer CLA
no flags Details | Diff
patch (2.47 KB, patch)
2010-03-04 15:40 EST, Andrew Niefer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2008-11-25 08:43:49 EST
As discussed in the call from Nov 24th 2008, it could be interesting to see if there is any benefit to be gained by having a query mechanism similar to the one of the metadata repositories. See also bug #256415.
Comment 1 Pascal Rapicault CLA 2009-11-03 13:22:07 EST
Andrew will be looking into this as part of fixing the problem ArtifactDescriptor identity.
Comment 2 Ian Bull CLA 2009-11-03 13:27:17 EST
We moved the Query stuff to the metadata bundle.  Does this still make sense if artifact repositories also support querying?
Comment 3 Pascal Rapicault CLA 2009-11-03 15:39:05 EST
We will move it if it is necessary.
Comment 4 Andrew Niefer CLA 2009-11-04 15:42:28 EST
Created attachment 151357 [details]
patch

This Patch makes IArtifactRepository extend IQueryable.

It also includes IArtifactQuery which uses IQuery#getProperty to indicate whether it is interested in IArtifactKeys or IArtifactDescriptors (or both).

Two basic ArtifactKeyQuery and ArtifactDescriptorQuery implementations, as well as an ArtifactIterator.

The implementation of query (currently in AbstractArtifactRepository) is untested, and subject to change (for example bug 256415 would have an impact here).

Susan/Ian let me know if you have any comments about the general shape of this.
Comment 5 Andrew Niefer CLA 2009-11-04 15:43:38 EST
(In reply to comment #2)
> We moved the Query stuff to the metadata bundle.  Does this still make sense if
> artifact repositories also support querying?

The artifact stuff depends on Version and IArtifactKey which are both in the metadata bundle, so I see no problem with the Query stuff staying there as well.
Comment 6 Andrew Niefer CLA 2009-11-06 13:03:21 EST
done in the branch.  IArtifactRepository implements IQueryable
Comment 7 Andrew Niefer CLA 2009-11-06 13:49:17 EST
More to do here, need some synchronization
Comment 8 Andrew Niefer CLA 2010-03-04 15:40:37 EST
Created attachment 161027 [details]
patch

Patch adds synchronization in descriptorQueryable().

Also some minor warning fixes
Comment 9 Thomas Hallgren CLA 2010-03-04 16:00:07 EST
Patch looks good to me.
Comment 10 Andrew Niefer CLA 2010-03-04 16:11:07 EST
Thanks Thomas.  Patch released.