Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use SMO service for class name and SHA1 queries. #5984

Merged
merged 1 commit into from
May 29, 2023

Conversation

mbien
Copy link
Member

@mbien mbien commented May 24, 2023

service https://github.com/apache/maven-indexer/tree/master/search-backend-smo (search maven org)

  • the remote index does not contain class name information anymore
  • sha1 queries are rarely used and contribute to index size, which makes them a good candidate for SMO too, this will also allow to progress with maven remote index filters #5922

dependency-search-ui

SearchDependencyUI window update.

  • 'local search' checkbox to limit search to local repos
  • move search-in-progress marker to top of the list
  • other minor fixes (labels/resizing etc)
  • code renovation / deprecation fixes

sha1 query latency is fairly usable, here is the nbm wizard trying to resolve dependencies:

INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=8, pageOffset=0}, query=sha1:afb2ce3d80d31a18a9d2ad532312e93a1fc8ad05} finished in 553 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=8, pageOffset=0}, query=sha1:ea59da7199e90dd8b1915ec5fa346b0fc0445235} finished in 124 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=8, pageOffset=0}, query=sha1:fe1f44c2917d776fc66c384b6314442a483d8801} finished in 150 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=8, pageOffset=0}, query=sha1:3392f14ad7125e85e46bcc98dfb7c323afef7f89} finished in 123 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=8, pageOffset=0}, query=sha1:e1a6e400b9cd9d0b42c03d368eb34c6d0e29a821} finished in 120 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=8, pageOffset=0}, query=sha1:4ea5950a57c2cde55d0281f61c3a16e66b0abcbd} finished in 123 ms

classname search can result in really bad latency, here a search for StringUtils which collects 10 pages (which I set as maximum for now):

INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=0}, query=cn:StringUtils} finished in 9,222 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=1}, query=cn:StringUtils} finished in 4,413 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=2}, query=cn:StringUtils} finished in 6,406 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=3}, query=cn:StringUtils} finished in 6,725 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=4}, query=cn:StringUtils} finished in 5,083 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=5}, query=cn:StringUtils} finished in 854 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=6}, query=cn:StringUtils} finished in 5,426 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=7}, query=cn:StringUtils} finished in 7,202 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=8}, query=cn:StringUtils} finished in 6,863 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=9}, query=cn:StringUtils} finished in 2,110 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=10}, query=cn:StringUtils} finished in 3,981 ms

FQ class names are not much better:

INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=0}, query=fqcn:dev.mbien.slf2jfr.JFRLogger} finished in 1,650 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=0}, query=fqcn:org.openide.awt.ActionID} finished in 4,446 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=0}, query=fqcn:org.openide.util.NbBundle.Messages} finished in 2,355 ms

how to test:
open/create maven project, type some class name, use the hint to do a maven search. Results should contain both central and local entries. Should work for simple class names and fully qualified class names.

I am not sure how useful the sha1 query actually is, since features like attach src/doc do seem to work even with indexing disabled since it uses GAV. The local repo index does also contain hash information which means that as soon the project is primed, the local index could be used for it.
https://github.com/search?q=repo%3Aapache%2Fnetbeans+findBySHA1&type=code

please note that the Dependencies -> Add Dependency... window does use a different code path (generic find query with arbitrary fields). Going to update that one some time later.

@mbien mbien added the Maven [ci] enable "build tools" tests label May 24, 2023
@mbien mbien added the ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) label May 24, 2023
@mbien mbien force-pushed the smo-augmented-index branch from 5277dc4 to 85b652e Compare May 24, 2023 19:43
@mbien mbien added this to the NB19 milestone May 24, 2023
@mbien mbien force-pushed the smo-augmented-index branch from 85b652e to d505314 Compare May 24, 2023 20:16
@mbien mbien marked this pull request as ready for review May 24, 2023 21:14
@mbien mbien requested a review from matthiasblaesing May 24, 2023 23:04
@mbien
Copy link
Member Author

mbien commented May 26, 2023

looks like the search service had a bad day yesterday, the latency is better today. This is the StringUtils search repeated from above:

INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=0}, query=cn:StringUtils} finished in 1,735 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=1}, query=cn:StringUtils} finished in 1,044 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=2}, query=cn:StringUtils} finished in 909 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=3}, query=cn:StringUtils} finished in 567 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=4}, query=cn:StringUtils} finished in 608 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=5}, query=cn:StringUtils} finished in 710 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=6}, query=cn:StringUtils} finished in 935 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=7}, query=cn:StringUtils} finished in 847 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=8}, query=cn:StringUtils} finished in 798 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=9}, query=cn:StringUtils} finished in 498 ms
INFO [org.netbeans.modules.maven.indexer.SMORequestResult]: SMO SearchRequest{paging=Paging{pageSize=128, pageOffset=10}, query=cn:StringUtils} finished in 407 ms

@mbien mbien force-pushed the smo-augmented-index branch from d505314 to dc314ca Compare May 26, 2023 04:43
@mbien mbien requested a review from neilcsmith-net May 26, 2023 04:48
Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane to me, thank you for this. I left an inline comment, but apart from that this is IMHO good to go.

 - the remote index does not contain class name information anymore
 - sha1 queries are rarely used and contribute to index size,
   which makes them a good candidate for SMO too
 - SMO allows us to use a search service for selected queries

SearchDependencyUI window update.

 - 'local search' checkbox to limit search to local repos
 - move search-in-progress marker to top of the list
 - other minor fixes (labels/resizing etc)
 - code renovation / deprecation fixes
@mbien mbien force-pushed the smo-augmented-index branch from dc314ca to 950911d Compare May 29, 2023 19:16
@mbien mbien merged commit 69716a2 into apache:master May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Maven [ci] enable "build tools" tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants