Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332095

Summary: [query] Repository query takes a long time when deleting a lot of IUs (from dropins)
Product: [Eclipse Project] Equinox Reporter: DJ Houghton <dj.houghton>
Component: p2Assignee: DJ Houghton <dj.houghton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: irbull, karasiuk, thomas
Version: 3.6.1   
Target Milestone: 3.6.2   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 324353    
Bug Blocks:    
Attachments:
Description Flags
patch
none
org.eclipse.equinox.p2.directorywatcher_1.0.202.R36x_v20100727
none
org.eclipse.equinox.p2.directorywatcher_1.0.203.R36x_v20101027 none

Description DJ Houghton CLA 2010-12-07 18:07:05 EST
Cloned to track release into R3.6.x stream.

+++ This bug was initially created as a clone of Bug #324353 +++

Created an attachment (id=178100)
profile output

This is a bug to address part 2 of bug 313953. Thomas, sorry I missed your questions in the original bug. Yes, there are almost 6000 files on disk which have been removed.

- copy test data (3000 features, 3000 plugins) to dropins folder
- start Eclipse
- shutdown
- delete all plugins and features except 1 of each
- start Eclipse
- this start takes almost 10min. 

Here is the query that we are performing:

// create a query that will identify all ius related to removed files.
// It's safe to compare a String with a File since the auto coercion will
// first convert the String into a File.
IQuery<IInstallableUnit> removeQuery = QueryUtil.createMatchQuery( //
	"$1.exists(x | properties[$0] == x)", FILE_NAME, removedFiles); //$NON-NLS-1$
IQueryResult<IInstallableUnit> toRemove = metadataRepository.query(removeQuery, null);
metadataRepository.removeInstallableUnits(toRemove.toUnmodifiableSet());

Thomas, is there a way we could re-write the query or do something differently here?
Comment 1 DJ Houghton CLA 2010-12-07 18:09:56 EST
Created attachment 184764 [details]
patch
Comment 2 DJ Houghton CLA 2010-12-08 16:52:17 EST
Created attachment 184820 [details]
org.eclipse.equinox.p2.directorywatcher_1.0.202.R36x_v20100727

JAR for testing.
Comment 3 DJ Houghton CLA 2010-12-14 09:58:25 EST
Created attachment 185136 [details]
org.eclipse.equinox.p2.directorywatcher_1.0.203.R36x_v20101027
Comment 4 DJ Houghton CLA 2010-12-20 11:58:29 EST
Patch released to maintenance branch.