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 14:58:57 UTC
[solr] branch main 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 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 19a02650ab7 SOLR-16869: Use Panama Vector apis for Java 20/21 (#1758)
19a02650ab7 is described below
commit 19a02650ab76b70f6437f2e05097ac400a974e69
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)
---
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 05a3594f63a..d34dea5e300 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -235,6 +235,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 ce4fd583bb2..b9aab9bbfd3 100644
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -1879,6 +1879,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 43f60f9628c..f0ba5839468 100755
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -1134,6 +1134,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