Bug 192467 - [prov] [repo] IMetadataRepository to return Iteration of InstallableUnits
Summary: [prov] [repo] IMetadataRepository to return Iteration of InstallableUnits
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Incubator (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M5   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on: 209992
Blocks:
  Show dependency tree
 
Reported: 2007-06-13 11:05 EDT by Pascal Rapicault CLA
Modified: 2008-01-02 17:32 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2007-06-13 11:05:56 EDT
The current API to list all the ius returns an InstallableUnit[]. This forces all the IUs to be loaded in memory which may not be suitable / scalable when running with very little memory, or when the content of many repositories needs to be loaded. Instead, the API should return an Iteration. Of course there may be concurrency issues when the repo is modified while it is being iterated though this advantage of this approach outweigh the drawbacks and repositories are usually pretty static.
Comment 1 Jeff McAffer CLA 2007-06-13 15:38:33 EDT
indeed and repos may be implemented such that they actually support concurrent modification.
Comment 2 Susan McCourt CLA 2007-11-14 14:11:00 EST
I think that getting the IU's from a Profile and from a metadata repo should work the same way.  I keep bumping into the inconsistency where the repo returns an array and the Profile returns the iterator.  I was going to use the queryable interface instead to keep it uniform, but given bug #192466, I'm not sure if that's so safe either.  
Comment 3 John Arthorne CLA 2007-12-13 17:15:44 EST
This has been addressed through new IQueryable API, which can return an Iterator.
Comment 4 Susan McCourt CLA 2007-12-13 19:59:30 EST
Reopening this one.
There is still the getInstallableUnits() API in IMetadataRepository, which returns an array, and getInstallableUnits() in Profile, which returns an Iterator.  I understand that the queryable interface for each class can be used to get an array or iterator, but if we are keeping a convenience method in these classes, shouldn't they behave the same?
Comment 5 John Arthorne CLA 2008-01-02 16:24:02 EST
Ugh. I have removed IMetadataRepository.getInstallableUnits(), fixing up all references to use queries, mostly with a visitor that avoids creating garbage arrays of all IUs in the repository.  I'm now onto Profile.getInstallableUnits(), but there are a lot of references to it, so it may take awhile.
Comment 6 John Arthorne CLA 2008-01-02 17:32:34 EST
Done.