You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2023/07/07 15:01:33 UTC
[solr] branch branch_9x updated: SOLR-16869: Use Panama Vector apis for Java 20/21 (#1758)
This is an automated email from the ASF dual-hosted git repository.
houston pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new cd5c142ab9e SOLR-16869: Use Panama Vector apis for Java 20/21 (#1758)
cd5c142ab9e is described below
commit cd5c142ab9e4b0b58111bd54249cab67a2163bd3
Author: Houston Putman <ho...@apache.org>
AuthorDate: Fri Jul 7 10:58:51 2023 -0400
SOLR-16869: Use Panama Vector apis for Java 20/21 (#1758)
(cherry picked from commit 19a02650ab76b70f6437f2e05097ac400a974e69)
---
solr/CHANGES.txt | 3 +++
solr/bin/solr | 7 +++++++
solr/bin/solr.cmd | 7 +++++++
3 files changed, 17 insertions(+)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 8f79c98682a..94028064026 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -201,6 +201,9 @@ Optimizations
* SOLR-16846: Use IndexOrDocValuesQuery for PointFields on Set queries. This improves the performance in some scenarios when
the set query is combined with other selective queries. (Tomás Fernández Löbbe, Alex Deparvu)
+* SOLR-16869: Enable Incubating Java Panama Vector APIs when using Java 20 or 21.
+ When run using compatible hardware, Vector search will see considerable speed up. (Houston Putman, Uwe Schindler)
+
Bug Fixes
---------------------
diff --git a/solr/bin/solr b/solr/bin/solr
index 4454db58807..4e649088251 100644
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -2344,6 +2344,13 @@ function start_solr() {
echo "Java $JAVA_VER_NUM detected. Enabled workaround for SOLR-16463"
fi
+ # Vector optimizations are only supported for Java 20 and 21 for now.
+ # This will need to change as Lucene is upgraded and newer Java versions are released
+ if [[ "$JAVA_VER_NUM" -ge "20" ]] && [[ "$JAVA_VER_NUM" -le "21" ]] ; then
+ SOLR_OPTS+=("--add-modules" "jdk.incubator.vector")
+ echo "Java $JAVA_VER_NUM detected. Incubating Panama Vector APIs have been enabled"
+ fi
+
SOLR_START_OPTS=('-server' "${JAVA_MEM_OPTS[@]}" "${GC_TUNE_ARR[@]}" "${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 936fa3be111..68b1ce2154b 100755
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -1290,6 +1290,13 @@ if !JAVA_MAJOR_VERSION! GEQ 17 (
echo Java %JAVA_MAJOR_VERSION% detected. Enabled workaround for SOLR-16463
)
+REM Vector optimizations are only supported for Java 20 and 21 for now.
+REM This will need to change as Lucene is upgraded and newer Java versions are released
+if !JAVA_MAJOR_VERSION! GEQ 20 if !JAVA_MAJOR_VERSION! LEQ 21 (
+ set SOLR_OPTS=%SOLR_OPTS% --add-modules jdk.incubator.vector
+ echo Java %JAVA_MAJOR_VERSION% detected. Incubating Panama Vector APIs have been enabled
+)
+
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