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

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 9eaa81e87f HDDS-9344. Allow multiple classpath items in 
OZONE_MANAGER_CLASSPATH (#5355)
9eaa81e87f is described below

commit 9eaa81e87f37d00f493ba59eceb4c3ddeb32d56e
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Wed Sep 27 21:46:24 2023 +0200

    HDDS-9344. Allow multiple classpath items in OZONE_MANAGER_CLASSPATH (#5355)
---
 hadoop-ozone/dist/src/main/compose/ozonesecure/vault.yaml     |  2 +-
 hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh          | 11 ++++++-----
 .../dist/src/shell/shellprofile.d/hadoop-ozone-manager.sh     |  2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/hadoop-ozone/dist/src/main/compose/ozonesecure/vault.yaml 
b/hadoop-ozone/dist/src/main/compose/ozonesecure/vault.yaml
index e429510fd1..b89b93621a 100644
--- a/hadoop-ozone/dist/src/main/compose/ozonesecure/vault.yaml
+++ b/hadoop-ozone/dist/src/main/compose/ozonesecure/vault.yaml
@@ -21,7 +21,7 @@ services:
       - vault.conf
     environment:
       - OZONE_OPTS=-Dcom.sun.net.ssl.checkRevocation=false
-      - 
OZONE_CLASSPATH=/opt/hadoop/share/ozone/lib/[email protected]@.jar:/opt/hadoop/share/ozone/lib/vault-java-driver-*.jar
+      - 
OZONE_MANAGER_CLASSPATH=/opt/hadoop/share/ozone/lib/[email protected]@.jar:/opt/hadoop/share/ozone/lib/[email protected]@.jar
   vault:
     image: hashicorp/vault:1.13.2
     hostname: vault
diff --git a/hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh 
b/hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh
index 175d3aa66b..500d7d446c 100755
--- a/hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh
+++ b/hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh
@@ -1288,9 +1288,9 @@ function ozone_add_ldlibpath
 ## @replaceable  yes
 function ozone_add_to_classpath_userpath
 {
-  # Add the user-specified OZONE_CLASSPATH to the
-  # official CLASSPATH env var if OZONE_USE_CLIENT_CLASSLOADER
-  # is not set.
+  # Add the classpath definition from argument (or OZONE_CLASSPATH if no
+  # argument specified) to the official CLASSPATH env var if
+  # OZONE_USE_CLIENT_CLASSLOADER is not set.
   # Add it first or last depending on if user has
   # set env-var OZONE_USER_CLASSPATH_FIRST
   # we'll also dedupe it, because we're cool like that.
@@ -1300,10 +1300,11 @@ function ozone_add_to_classpath_userpath
   declare -i j
   declare -i i
   declare idx
+  local userpath="${1:-${OZONE_CLASSPATH}}"
 
-  if [[ -n "${OZONE_CLASSPATH}" ]]; then
+  if [[ -n "${userpath}" ]]; then
     # I wonder if Java runs on VMS.
-    for idx in $(echo "${OZONE_CLASSPATH}" | tr : '\n'); do
+    for idx in $(echo "${userpath}" | tr : '\n'); do
       array[${c}]=${idx}
       ((c=c+1))
     done
diff --git a/hadoop-ozone/dist/src/shell/shellprofile.d/hadoop-ozone-manager.sh 
b/hadoop-ozone/dist/src/shell/shellprofile.d/hadoop-ozone-manager.sh
index c915402ee2..af5d842efd 100644
--- a/hadoop-ozone/dist/src/shell/shellprofile.d/hadoop-ozone-manager.sh
+++ b/hadoop-ozone/dist/src/shell/shellprofile.d/hadoop-ozone-manager.sh
@@ -23,6 +23,6 @@ _ozone_manager_hadoop_finalize() {
      [[ -n ${OZONE_MANAGER_CLASSPATH} ]];
   then
     echo "Ozone Manager classpath extended by ${OZONE_MANAGER_CLASSPATH}"
-    ozone_add_classpath "${OZONE_MANAGER_CLASSPATH}"
+    ozone_add_to_classpath_userpath "${OZONE_MANAGER_CLASSPATH}"
   fi
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to