You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "vigyasharma (via GitHub)" <gi...@apache.org> on 2024/04/11 19:32:28 UTC

[PR] backport gh 13202 [lucene]

vigyasharma opened a new pull request, #13295:
URL: https://github.com/apache/lucene/pull/13295

   - Add timeout support to AbstractKnnVectorQuery (#13202)
   - Fix failing BaseKnnVectorQueryTestCase#testTimeout (#13283)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Backport #13202 to branch_9x [lucene]

Posted by "benwtrent (via GitHub)" <gi...@apache.org>.
benwtrent commented on code in PR #13295:
URL: https://github.com/apache/lucene/pull/13295#discussion_r1561781640


##########
lucene/core/src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java:
##########
@@ -797,6 +800,77 @@ public void testBitSetQuery() throws IOException {
     }
   }
 
+  /** Test functionality of {@link TimeLimitingKnnCollectorManager}. */
+  public void testTimeLimitingKnnCollectorManager() throws IOException {
+    try (Directory indexStore =
+            getIndexStore("field", new float[] {0, 1}, new float[] {1, 2}, new float[] {0, 0});
+        IndexReader reader = DirectoryReader.open(indexStore)) {
+      IndexSearcher searcher = newSearcher(reader);
+
+      KnnCollectorManager delegate = new TopKnnCollectorManager(3, searcher);
+
+      // A collector manager with no timeout
+      TimeLimitingKnnCollectorManager noTimeoutManager =
+          new TimeLimitingKnnCollectorManager(delegate, null);
+      KnnCollector noTimeoutCollector =
+          noTimeoutManager.newCollector(Integer.MAX_VALUE, searcher.leafContexts.getFirst());

Review Comment:
   Pretty sure `getFirst` is a JDK21+ only thing. The compilation level on branch_9x is too low to allow that API.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Backport #13202 to branch_9x [lucene]

Posted by "vigyasharma (via GitHub)" <gi...@apache.org>.
vigyasharma commented on PR #13295:
URL: https://github.com/apache/lucene/pull/13295#issuecomment-2062493037

   Backported changes directly to retain original commit messages. This PR would've needed a squash merge as it was not rebased on the latest branch_9x commit.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Backport #13202 to branch_9x [lucene]

Posted by "vigyasharma (via GitHub)" <gi...@apache.org>.
vigyasharma commented on PR #13295:
URL: https://github.com/apache/lucene/pull/13295#issuecomment-2050384100

   Now that the test failure have been fixed, I'm backporting #13202 to `branck_9x`. Running into some build issues on my local setup, which I think are unrelated to the commit. Opening this PR to run precommit checks before backporting.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Backport #13202 to branch_9x [lucene]

Posted by "vigyasharma (via GitHub)" <gi...@apache.org>.
vigyasharma commented on PR #13295:
URL: https://github.com/apache/lucene/pull/13295#issuecomment-2050540712

   Getting the same test failure here.
   
   ```java
   > Task :lucene:core:compileTestJava
   /home/runner/work/lucene/lucene/lucene/core/src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java:816: error: cannot find symbol
             noTimeoutManager.newCollector(Integer.MAX_VALUE, searcher.leafContexts.getFirst());
                                                                                   ^
     symbol:   method getFirst()
     location: variable leafContexts of type List<LeafReaderContext>
   /home/runner/work/lucene/lucene/lucene/core/src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java:832: error: cannot find symbol
             timeoutManager.newCollector(Integer.MAX_VALUE, searcher.leafContexts.getFirst());
                                                                                 ^
     symbol:   method getFirst()
     location: variable leafContexts of type List<LeafReaderContext>
   Note: Some input files use or override a deprecated API.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Backport #13202 to branch_9x [lucene]

Posted by "vigyasharma (via GitHub)" <gi...@apache.org>.
vigyasharma closed pull request #13295: Backport #13202 to branch_9x
URL: https://github.com/apache/lucene/pull/13295


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org