Re: Maven search that uses the online APIs instead of the local index
Tomas Stupka <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.devel |
|---|---|
| Message-ID | <[email protected]> |
created an issue to cover the api/spi changes in maven.indexer. lets continue there. https://netbeans.org/bugzilla/show_bug.cgi?id=257567 <https://netbeans.org/bugzilla/show_bug.cgi?id=257567> let me know if the attached patch covers what was already discussed thanks t. > On 11 Jan 2016, at 15:07, Emilian Bold <[email protected]> wrote: > > >For the start, or if nothing else, i would suggest we change the api so that you can access the queries and RepositoryQueries.Result and see how far you get with other queries ... > > Yes, please. I also need access to the Accessor so I can instantiate Result. > > >a bit ‘heavy’ - do you see this as a principial problem or did you already run into particular performance problems? > > The online Maven API doesn't provide as much data as you could query from Lucene. So, I would have to make multiple requests in order to get the artifacts and then for each artifact all the versions. But this is largely not necessary since I doubt people expand all the artifact nodes to see the versions -- only one or two nodes will be expanded. This is why lazy-loading the children for those nodes would be better and it would allow me to make fewer http requests. > > This would imply some changes in MavenNodeFactory. > > Right now a generic query only returns the latestVersion. > > >- the user should be able to make the choice if the online or offline index should be used > > Yes, some settings panel would be nice for this. > > >- not all repos provide the search service > > I am explicitly using this only for 'central'. > > > - how to deal with cases when the network isn't available > > I can probably add some icon in the status bar then. > > I would also add the repository as 'skipped' in RepositoryQueries.Result. This will be shown in the UI as containing partial results. > > --emi > > > > On Mon, Jan 11, 2016 at 3:18 PM, Tomas Stupka <[email protected] <mailto:[email protected]>> wrote: > Hi, > > we looked into it some time ago and weren’t satisfied with how the api worked. Can’t remember out of the top of my head, but from a brief look right now it seems that all (or most) of the queries could be covered by the api > > > Let me know what do you think so far and how could we get the existing maven.indexer APIs to a point where I can at least publish the plugin in the Plugin Portal for testing. > For the start, or if nothing else, i would suggest we change the api so that you can access the queries and RepositoryQueries.Result and see how far you get with other queries ... > On the way we can get a better idea what other areas of the IDE it will impact. (as mentioned bellow) > > > * the Add Dependency UI and logic is a bit 'heavy' compared to the online APIs. For example, it loads all the versions for a given artifact at once instead of lazy loading the versions only when a node is expanded (see MavenNodeFactory). Lazy loading would map better to a 2nd search using the online API. > a bit ‘heavy’ - do you see this as a principial problem or did you already run into particular performance problems? > feel free to file a task for this (patches are, of course, welcome) > > > * existing code assumes a single GenericFindQuery service provider (I fixed this by adding a composite service on the 1st position) > on the long turn we would have to figure out a better solution. Also that there will be more problems we would have to resolve in the maven infrastructure and UI if this has to work properly. > - the user should be able to make the choice if the online or offline index should be used > - not all repos provide the search service > - how to deal with cases when the network isn't available > - etc. > > regards > t. > > >