Great news: Lucene 9.4 (optionally) uses mapped MemorySegments when JDK 19 is detected

Chris Hegarty chegar999 at gmail.com
Fri Sep 30 08:32:29 UTC 2022


Hi,

On 30/09/2022 08:40, Remi Forax wrote:
> Hi Uwe,
> i wonder if you will not be in trouble when Java 20 will be out with your multi-releases jar,

 From my reading of the code, there will be no issue with Java 20.

Access to the Java 19 preview-enabled code, which lives exclusively 
within the META-INF/versions/19 section, is mediated through reflective 
checks in non-versioned non-preview-enabled code, which tolerates the 
inability to load (even for a Java 20 preview-enabled, or disabled, 
runtime). It's likely however that a Java 20 specific section will be 
need soon anyway.

We're super excited to experiment with Elasticsearch running with 
preview enabled. Both to flush out possible bugs and issue in our CI, as 
well as run some performance experiments.

-Chris.


> because the VM 10 will try to run the bytecodes under the 19 folder and because it is compiled with --enable-preview --source 19, it will not work.
> 
> (Alan in CC, to check i'm not saying something stupid.)
> 
> regards,
> Rémi
> 
> ----- Original Message -----
>> From: "Uwe Schindler" <uschindler at apache.org>
>> To: "Maurizio Cimadamore" <maurizio.cimadamore at oracle.com>, panama-dev at openjdk.org
>> Sent: Thursday, September 29, 2022 5:46:40 PM
>> Subject: Great news: Lucene 9.4 (optionally) uses mapped MemorySegments when JDK 19 is detected
> 
>> Hi all, hi Maurizio,
>>
>> I just wanted to inform you that after Java 19 was released we jumped on
>> the train and we will most likely release Apache Lucene 9.4 already
>> tomorrow with support for project Panama. Users can run Lucene-based
>> applications with "--enable-preview" and all should work automatically
>> thanks to MR-JAR.
>>
>> The PR was merged on Monday after Eclipse Adoptium made the JDK 19
>> builds available, so Gradle was able to pick them up to compile the
>> MR-JAR part against it without having the Lucene developer to install
>> JDK 19 in addition to Java 11/17. You can see the Panama code and also
>> the Gradle setup and classloading tricks at runtime (that create/support
>> the MR-JAR) here: https://github.com/apache/lucene/pull/912
>>
>> I also opened issues in Elasticsearch ad Opensearch, so users can test
>> it and report slowness/bugs earlier:
>> https://github.com/elastic/elasticsearch/issues/90526,
>> https://github.com/opensearch-project/OpenSearch/issues/4637
>>
>> Uwe
>>
>> --
>> Uwe Schindler
>> uschindler at apache.org
>> ASF Member, Member of PMC and Committer of Apache Lucene and Apache Solr
>> Bremen, Germany
>> https://lucene.apache.org/
>> https://solr.apache.org/


More information about the panama-dev mailing list