Mailing List Archive

Re: (lucene) branch main updated: Use jdk11 primitives in test to allow backport to branch_9x (#13311)
Hi,

why did you not first backport and apply this change only to 9.x?

If we have better methods available in Java 21, why not use them? We
also change large parts of code to "record" classes, also not available
in Java 11.

Uwe

Am 17.04.2024 um 08:17 schrieb vigyasharma@apache.org:
> This is an automated email from the ASF dual-hosted git repository.
>
> vigyasharma pushed a commit to branch main
> in repository https://gitbox.apache.org/repos/asf/lucene.git
>
>
> The following commit(s) were added to refs/heads/main by this push:
> new bc678ac67e3 Use jdk11 primitives in test to allow backport to branch_9x (#13311)
> bc678ac67e3 is described below
>
> commit bc678ac67e32c55a27a4e8950c25144cc89cef66
> Author: Vigya Sharma <vigya.work@gmail.com>
> AuthorDate: Tue Apr 16 23:17:43 2024 -0700
>
> Use jdk11 primitives in test to allow backport to branch_9x (#13311)
> ---
> .../src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lucene/core/src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java b/lucene/core/src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java
> index 2ae0ae14a29..2546115ff4f 100644
> --- a/lucene/core/src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java
> +++ b/lucene/core/src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java
> @@ -781,7 +781,7 @@ abstract class BaseKnnVectorQueryTestCase extends LuceneTestCase {
> TimeLimitingKnnCollectorManager noTimeoutManager =
> new TimeLimitingKnnCollectorManager(delegate, null);
> KnnCollector noTimeoutCollector =
> - noTimeoutManager.newCollector(Integer.MAX_VALUE, searcher.leafContexts.getFirst());
> + noTimeoutManager.newCollector(Integer.MAX_VALUE, searcher.leafContexts.get(0));
>
> // Check that a normal collector is created without timeout
> assertTrue(noTimeoutCollector instanceof TopKnnCollector);
> @@ -797,7 +797,7 @@ abstract class BaseKnnVectorQueryTestCase extends LuceneTestCase {
> TimeLimitingKnnCollectorManager timeoutManager =
> new TimeLimitingKnnCollectorManager(delegate, () -> true);
> KnnCollector timeoutCollector =
> - timeoutManager.newCollector(Integer.MAX_VALUE, searcher.leafContexts.getFirst());
> + timeoutManager.newCollector(Integer.MAX_VALUE, searcher.leafContexts.get(0));
>
> // Check that a time limiting collector is created, which returns partial results
> assertFalse(timeoutCollector instanceof TopKnnCollector);
>
--
Uwe Schindler
Achterdiek 19, D-28357 Bremen
https://www.thetaphi.de
eMail: uwe@thetaphi.de


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: (lucene) branch main updated: Use jdk11 primitives in test to allow backport to branch_9x (#13311) [ In reply to ]
Yes, I'll prefer applying the change only to 9.x in future. I was worried
we'd get recurring conflicts on this file in the backport branch, but it's
not a very high touch test function, so now, I don't think it's a big
concern.

On Tue, Apr 16, 2024 at 11:57?PM Uwe Schindler <uwe@thetaphi.de> wrote:

> Hi,
>
> why did you not first backport and apply this change only to 9.x?
>
> If we have better methods available in Java 21, why not use them? We
> also change large parts of code to "record" classes, also not available
> in Java 11.
>
> Uwe
>
> Am 17.04.2024 um 08:17 schrieb vigyasharma@apache.org:
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > vigyasharma pushed a commit to branch main
> > in repository https://gitbox.apache.org/repos/asf/lucene.git
> >
> >
> > The following commit(s) were added to refs/heads/main by this push:
> > new bc678ac67e3 Use jdk11 primitives in test to allow backport to
> branch_9x (#13311)
> > bc678ac67e3 is described below
> >
> > commit bc678ac67e32c55a27a4e8950c25144cc89cef66
> > Author: Vigya Sharma <vigya.work@gmail.com>
> > AuthorDate: Tue Apr 16 23:17:43 2024 -0700
> >
> > Use jdk11 primitives in test to allow backport to branch_9x (#13311)
> > ---
> > .../src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java
> | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git
> a/lucene/core/src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java
> b/lucene/core/src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java
> > index 2ae0ae14a29..2546115ff4f 100644
> > ---
> a/lucene/core/src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java
> > +++
> b/lucene/core/src/test/org/apache/lucene/search/BaseKnnVectorQueryTestCase.java
> > @@ -781,7 +781,7 @@ abstract class BaseKnnVectorQueryTestCase extends
> LuceneTestCase {
> > TimeLimitingKnnCollectorManager noTimeoutManager =
> > new TimeLimitingKnnCollectorManager(delegate, null);
> > KnnCollector noTimeoutCollector =
> > - noTimeoutManager.newCollector(Integer.MAX_VALUE,
> searcher.leafContexts.getFirst());
> > + noTimeoutManager.newCollector(Integer.MAX_VALUE,
> searcher.leafContexts.get(0));
> >
> > // Check that a normal collector is created without timeout
> > assertTrue(noTimeoutCollector instanceof TopKnnCollector);
> > @@ -797,7 +797,7 @@ abstract class BaseKnnVectorQueryTestCase extends
> LuceneTestCase {
> > TimeLimitingKnnCollectorManager timeoutManager =
> > new TimeLimitingKnnCollectorManager(delegate, () -> true);
> > KnnCollector timeoutCollector =
> > - timeoutManager.newCollector(Integer.MAX_VALUE,
> searcher.leafContexts.getFirst());
> > + timeoutManager.newCollector(Integer.MAX_VALUE,
> searcher.leafContexts.get(0));
> >
> > // Check that a time limiting collector is created, which
> returns partial results
> > assertFalse(timeoutCollector instanceof TopKnnCollector);
> >
> --
> Uwe Schindler
> Achterdiek 19, D-28357 Bremen
> https://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

--
- Vigya