Skip to content

Commit

Permalink
Allow mmap to use new preview JDK-19 APIs in Apache Lucene 9.4+ (#5151)
Browse files Browse the repository at this point in the history
* Allow mmap to use new preview JDK-19 APIs in Apache Lucene 9.4+

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

* Align javadoc release with target compatibility settings

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
  • Loading branch information
reta authored Nov 8, 2022
1 parent 6cbca61 commit fc47572
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Apply reproducible builds configuration for OpenSearch plugins through gradle plugin ([#4746](https://github.com/opensearch-project/OpenSearch/pull/4746))
- Add project health badges to the README.md ([#4843](https://github.com/opensearch-project/OpenSearch/pull/4843))
- [Test] Add IAE test for deprecated edgeNGram analyzer name ([#5040](https://github.com/opensearch-project/OpenSearch/pull/5040))
- Allow mmap to use new JDK-19 preview APIs in Apache Lucene 9.4+ ([#5151](https://github.com/opensearch-project/OpenSearch/pull/5151))

### Dependencies
- Bumps `log4j-core` from 2.18.0 to 2.19.0
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,7 @@ allprojects {
javadoc.options.encoding = 'UTF8'
javadoc.options.addStringOption('Xdoclint:all,-missing', '-quiet')
javadoc.options.tags = ["opensearch.internal", "opensearch.api", "opensearch.experimental"]
if (BuildParams.runtimeJavaVersion >= JavaVersion.VERSION_19) {
javadoc.options.addBooleanOption("-enable-preview", true)
javadoc.options.addStringOption("-release", BuildParams.runtimeJavaVersion.majorVersion)
}
javadoc.options.addStringOption("-release", targetCompatibility.majorVersion)
}

// support for reproducible builds
Expand Down Expand Up @@ -416,6 +413,9 @@ gradle.projectsEvaluated {
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_17) {
task.jvmArgs += ["-Djava.security.manager=allow"]
}
if (BuildParams.runtimeJavaVersion >= JavaVersion.VERSION_19) {
task.jvmArgs += ["--enable-preview"]
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions distribution/src/config/jvm.options
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@ ${error.file}

# Explicitly allow security manager (https://bugs.openjdk.java.net/browse/JDK-8270380)
18-:-Djava.security.manager=allow

# Allow mmap to use new JDK-19 preview APIs in Apache Lucene 9.4 (https://github.com/opensearch-project/OpenSearch/issues/4637)
19-:--enable-preview

0 comments on commit fc47572

Please sign in to comment.