Bug 249670 - [repo] Query.perform should take a progress monitor
Summary: [repo] Query.perform should take a progress monitor
Status: CLOSED 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 normal (vote)
Target Milestone: 3.6   Edit
Assignee: Ian Bull CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2008-10-03 22:03 EDT by Pascal Rapicault CLA
Modified: 2010-03-09 08:04 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 2008-10-03 22:03:10 EDT
The query#perform method should take a progress monitor in argument to allow for cancellation while iterating over a large set of entries.
Comment 1 Susan McCourt CLA 2008-10-13 14:49:08 EDT
see also bug 214645 for some previous discussion on this topic
Comment 2 Pascal Rapicault CLA 2008-12-10 10:23:46 EST
Ian, you may want to look into that one while you are doing the Collector changes.
Comment 3 Ian Bull CLA 2008-12-10 12:15:05 EST
Ok, I'm assigning this to me so I can track it easier.  Thanks Pascal.
Comment 4 Ian Bull CLA 2009-01-19 12:56:12 EST
(In reply to comment #3)
> Ok, I'm assigning this to me so I can track it easier.  Thanks Pascal.
> 

With all the work I'm doing around queries, this should be pretty easy.  The only problem is how much work do we give the progress monitor?  Queries take an iterator, and we don't necessarily know the size.  

One option is to provide two perform methods, one with a monitor (and size) and one without.  The second will delegate to the first (with null), and if the progress monitor is provided, it will be used, otherwise no progress will be tracked.

Is there other options for tracking progress when we don't know how much progress to track?
Comment 5 Ian Bull CLA 2009-02-12 15:19:35 EST
Updating milestone field.  

Any thoughts on comment #4?
Comment 6 Ian Bull CLA 2009-03-31 15:05:22 EDT
 Since we are in API freeze (and this would be an API change) I propose we wait until 3.6 for this one.  Thoughts?
Comment 7 Pascal Rapicault CLA 2009-03-31 15:37:09 EDT
Marking 4.o since we don't have a better milestone for now.
Comment 8 Pascal Rapicault CLA 2010-01-27 20:59:36 EST
Still interested in that Ian?
Comment 9 Thomas Hallgren CLA 2010-02-19 18:45:14 EST
When moving to expression based queries it will be difficult to do proper progress monitoring during evaluation. It would slow things down significantly.

It would be feasible to start a query by asking for a monitor with IProgressMonitor.UNKNOWN. The expression evaluator could then tick this monitor and check it for cancellation on a regular basis until the query is complete. That would mean that no monitor or submonitors needs to be passed down to the actual evaluation methods. Instead, the monitor can be kept in the evaluation context. No "progress" is reported, but at least there would be an indication that it is alive and can be cancelled.
Comment 10 Pascal Rapicault CLA 2010-03-09 08:04:38 EST
No further work planned on this.