Bug 226277 - Provide a way to run FileTaskScanners without indexing
Provide a way to run FileTaskScanners without indexing
Status: NEW
Product: platform
Classification: Unclassified
Component: Action Items
7.4
All All
: P3 (vote)
: TBD
Assigned To: Jan Peska
issues@platform
:
Depends on: 218534 227107
Blocks: 184292
  Show dependency treegraph
 
Reported: 2013-02-18 14:02 UTC by Egor Ushakov
Modified: 2013-05-10 11:36 UTC (History)
6 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
FileScanningWorker patch (3.45 KB, patch)
2013-02-26 09:21 UTC, Egor Ushakov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Egor Ushakov 2013-02-18 14:02:55 UTC
We're trying to implement ToDo list in cnd without using indexing because of performance issues that comes with it (scanning too much file types etc.) Currently FileTaskScanner.scan is called from TaskIndexer (indexing) and unused class FileScanningWorker (closed API). We want ToDo list to be lazy so that indexing only start when user opens the view. At the same time we want to reuse current TodoTaskScanner with options ui.
Now we have a prototype that works with FileScanningWorker. Is it possible to make it publicly available? Or is there any other public way to reuse TodoTaskScanner without using indexing?
Comment 1 David Strupl 2013-02-18 15:10:37 UTC
Adding Tomas on Cc: ...
Comment 2 Tomas Zezula 2013-02-18 15:25:38 UTC
As far as I know we discussed the possibility to trigger task list lazily (using the indexer) when  the TaskList is opened. This would be very helpful as the task list overhead (FileScanner + other non badging providers) can be removed from scanning time and run when the TL is opened (and probably cancelled when it's closed). This was discussed on some performance team and would be very helpful.
Comment 3 Jan Peska 2013-02-19 08:54:52 UTC
(In reply to comment #2)
> As far as I know we discussed the possibility to trigger task list lazily
> (using the indexer) when  the TaskList is opened. This would be very helpful as
> the task list overhead (FileScanner + other non badging providers) can be
> removed from scanning time and run when the TL is opened (and probably
> cancelled when it's closed). This was discussed on some performance team and
> would be very helpful.

I'm not sure if I understand it right what you meant by "trigger task list lazily", detach TaskList from Indexing when closed, or something else?

Right now it TaskList is lazy in the meaning of it does not scan anything when the window is closed (see TaskIndexer.java:85) and then re-scan if needed (if the cache is dirty).

Changing Issue Type to ENHANCEMENT
Comment 4 Egor Ushakov 2013-02-19 08:58:02 UTC
Maybe I should have specified it this way:
Provide a way to run FileTaskScanners without indexing

The only way to do it now is to use private FileScanningWorker.
Comment 5 Tomas Zezula 2013-02-19 12:30:48 UTC
>Right now it TaskList is lazy in the meaning of it does not scan anything when
>the window is closed.
Not true, the TaskList is only partially lazy (the fix of the issue #206026 fixed the Todo provider), however the other TL providers like expensive HTML validation are still uselessly running in the scan time even when the TL is closed.
Comment 6 Jan Peska 2013-02-20 08:39:54 UTC
I'm afraid I'm missing something. All FileTaskScanners are called to scan only from TaskIndexer and only when the window is opened. So I guess there is a problem with PushTaskScanners, right? But still they are detached when the window is closed. Can you send me a link to the source of the HTML validation provider you mentioned? 

Thanks
Comment 7 Egor Ushakov 2013-02-25 08:38:01 UTC
Guys, let's not mix several issues into this one. I have a prototype that use FileTaskScanners without indexing via FileScanningWorker from tasklist.impl. Could you either:
1. Move FileScanningWorker to public API
or
2. Introduce a way to use FileTaskScanners without indexing
Comment 8 Jan Peska 2013-02-25 09:32:17 UTC
(In reply to comment #7)
> Guys, let's not mix several issues into this one. I have a prototype that use
> FileTaskScanners without indexing via FileScanningWorker from tasklist.impl.
> Could you either:
> 1. Move FileScanningWorker to public API
> or
> 2. Introduce a way to use FileTaskScanners without indexing

Well honestly I don't think we should do it either way. There is already a way how to add task without indexing - you need to implement PushTaskScanner. PushTaskScanners are not "listening" on Indexing, but task list let them know if if there is a scope selected so you can scan relevant files when it is really needed.
Comment 9 Egor Ushakov 2013-02-25 10:31:07 UTC
That's exactly what I do - implement PushTaskScanner. The question is how to invoke TodoTaskScanner from there (it has all settings and the functionality we need).
Comment 10 Jan Peska 2013-02-25 10:53:33 UTC
(In reply to comment #9)
> That's exactly what I do - implement PushTaskScanner. The question is how to
> invoke TodoTaskScanner from there (it has all settings and the functionality we
> need).

I understand you would like to use current Todo scanner but I won't provide a way to invoke providers from the outside (in this case from another provider) it would be a hack just for this particular case and it should not be in API. 

I can't come up with any "clean" solution how to take advantage of Todo scanner but you can consider using it directly (implementation dependency) but as I said, it is not very nice...
Comment 11 Egor Ushakov 2013-02-26 09:21:55 UTC
Created attachment 131885 [details]
FileScanningWorker patch

Ok, I'll implement it with implementation dependency for now.
Even so, attached patch is required to be applied to FileScanningWorker, any objections?
Comment 12 Egor Ushakov 2013-02-26 12:40:08 UTC
I've applied the patch and pushed the prototype on cnd side:
http://hg.netbeans.org/cnd-main/rev/f44d66f6554a
http://hg.netbeans.org/cnd-main/rev/ef5c1f547b07
we'll see how it works and possibly find a solution without implementation dependencies
Comment 13 Jan Peska 2013-02-26 14:18:37 UTC
(In reply to comment #11)
> Created attachment 131885 [details]
> FileScanningWorker patch
> 
> Ok, I'll implement it with implementation dependency for now.
> Even so, attached patch is required to be applied to FileScanningWorker, any
> objections?

I'm afraid that you misunderstood what I've meant. You don't need to use FileScanningWorker at all. 

1. Add implementation dependency directly on TODO scanner
2. Use TODO scanner to scan files from active scope - you will get tasks
3. Use Callback.setTasks to push tasks to the TaskList

Like that you won't mess up with the infrastructure and still you will get all settings etc.
Comment 14 Egor Ushakov 2013-02-26 15:09:22 UTC
I will try, thanks!
Comment 15 Egor Ushakov 2013-02-26 16:32:52 UTC
Here is an implementation without use of FileScanningWorker and implementation dependencies, I lookup TodoTaskScanner by class name:
http://hg.netbeans.org/cnd-main/rev/28d6f1bdef43
I will test it and see how it works together with other FileTaskScanners...


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo