You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by kr...@apache.org on 2022/10/28 16:21:57 UTC

[solr] branch main updated: SOLR-16500: Added --enable-preview for JDK 19 to enable MemorySegment support in MMapDirectory (#1142)

This is an automated email from the ASF dual-hosted git repository.

krisden pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new dbb085ac57f SOLR-16500: Added --enable-preview for JDK 19 to enable MemorySegment support in MMapDirectory (#1142)
dbb085ac57f is described below

commit dbb085ac57ffc9c4a754b78327491a4116be54f9
Author: Kevin Risden <ri...@users.noreply.github.com>
AuthorDate: Fri Oct 28 12:21:50 2022 -0400

    SOLR-16500: Added --enable-preview for JDK 19 to enable MemorySegment support in MMapDirectory (#1142)
---
 solr/CHANGES.txt  | 2 ++
 solr/bin/solr     | 6 ++++++
 solr/bin/solr.cmd | 7 +++++++
 3 files changed, 15 insertions(+)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index cd0bca1e500..fb82b6060df 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -35,6 +35,8 @@ New Features
 
 * SOLR-16435: Add Request timeout to Http2SolrClient (Tomás Fernández Löbbe)
 
+* SOLR-16500: Added --enable-preview for JDK 19 to enable MemorySegment support in MMapDirectory (Kevin Risden)
+
 Improvements
 ---------------------
 
diff --git a/solr/bin/solr b/solr/bin/solr
index fd0a7d6a36f..704efcb724f 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -2250,6 +2250,12 @@ function start_solr() {
     echo "Java $JAVA_VER_NUM detected. Enabled workaround for SOLR-16463"
   fi
 
+  # Added --enable-preview for JDK 19 to enable MemorySegment support in MMapDirectory, see https://issues.apache.org/jira/browse/SOLR-16500
+  if [[ "$JAVA_VER_NUM" -eq "19" ]] ; then
+    SOLR_OPTS+=("--enable-preview")
+    echo "Java $JAVA_VER_NUM detected. Added --enable-preview to enable MemorySegment support in MMapDirectory. See SOLR-16500"
+  fi
+
   SOLR_START_OPTS=('-server' "${JAVA_MEM_OPTS[@]}" "${GC_TUNE[@]}" "${GC_LOG_OPTS[@]}" "${IP_ACL_OPTS[@]}" \
     "${REMOTE_JMX_OPTS[@]}" "${CLOUD_MODE_OPTS[@]}" ${SOLR_LOG_LEVEL_OPT:-} -Dsolr.log.dir="$SOLR_LOGS_DIR" \
     "-Djetty.port=$SOLR_PORT" "-DSTOP.PORT=$stop_port" "-DSTOP.KEY=$STOP_KEY" \
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index 17ccf4f83f0..7960e9065de 100755
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -1253,6 +1253,13 @@ if !JAVA_MAJOR_VERSION! GEQ 17  (
   echo Java %JAVA_MAJOR_VERSION% detected. Enabled workaround for SOLR-16463
 )
 
+REM Added --enable-preview for JDK 19 to enable MemorySegment support in MMapDirectory. See https://issues.apache.org/jira/browse/SOLR-16500
+
+if !JAVA_MAJOR_VERSION! EQU 19  (
+  set SOLR_OPTS=%SOLR_OPTS% --enable-preview
+  echo Java $JAVA_VER_NUM detected. Added --enable-preview to enable MemorySegment support in MMapDirectory. See SOLR-16500
+)
+
 if !JAVA_MAJOR_VERSION! GEQ 9 if NOT "%JAVA_VENDOR%" == "OpenJ9" (
   IF NOT "%GC_LOG_OPTS%"=="" (
     echo ERROR: On Java 9 you cannot set GC_LOG_OPTS, only default GC logging is available. Exiting