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-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org