This is an automated email from the ASF dual-hosted git repository.
stoty pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/master by this push:
new 22a951b1b5 PHOENIX-7563 Use HBASE_OPTS as a fallback for PHOENIX_OPTS
(#2099)
22a951b1b5 is described below
commit 22a951b1b5a58e5909ba2a0fd7cecaacf3b63622
Author: Istvan Toth <[email protected]>
AuthorDate: Tue Apr 8 11:54:08 2025 +0200
PHOENIX-7563 Use HBASE_OPTS as a fallback for PHOENIX_OPTS (#2099)
---
bin/performance.py | 8 +++++---
bin/psql.py | 8 +++++---
bin/sqlline.py | 7 +++++--
3 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/bin/performance.py b/bin/performance.py
index 6ef11c2be8..23995354d1 100755
--- a/bin/performance.py
+++ b/bin/performance.py
@@ -65,10 +65,12 @@ phoenix_utils.setPath()
java_cmd = phoenix_utils.java
-execute = ('%s %s $HBASE_OPTS $PHOENIX_OPTS -cp "%s%s%s%s%s"' +
+opts = os.getenv('PHOENIX_OPTS') or os.getenv('HBASE_OPTS') or ''
+
+execute = ('%s %s ' + opts + ' -cp "%s%s%s%s%s"' +
'
-Djava.util.logging.config.class=org.apache.hadoop.hbase.logging.JulToSlf4jInitializer
' +
- ' -Dlog4j2.configurationFile=file:' +
- os.path.join(phoenix_utils.current_dir, "log4j2.properties") +
+ ('' if '-Dlog4j2.configurationFile' in opts else '
-Dlog4j2.configurationFile=file:'
+ + os.path.join(phoenix_utils.current_dir, "log4j2.properties")) +
' org.apache.phoenix.util.PhoenixRuntime -t %s %s ') % \
(java_cmd, phoenix_utils.jvm_module_flags, hbase_config_path, os.pathsep,
phoenix_utils.slf4j_backend_jar, os.pathsep,
diff --git a/bin/psql.py b/bin/psql.py
index b33b888949..5a558775df 100755
--- a/bin/psql.py
+++ b/bin/psql.py
@@ -30,15 +30,17 @@ phoenix_utils.setPath()
args = phoenix_utils.shell_quote(sys.argv[1:])
+opts = os.getenv('PHOENIX_OPTS') or os.getenv('HBASE_OPTS') or ''
+
java_cmd = phoenix_utils.java + ' ' + phoenix_utils.jvm_module_flags + \
- ' $HBASE_OPTS $PHOENIX_OPTS ' + \
+ ' ' + opts + \
' -cp "' + phoenix_utils.hbase_conf_dir + os.pathsep +
phoenix_utils.hadoop_conf + \
os.pathsep + phoenix_utils.slf4j_backend_jar + \
os.pathsep + phoenix_utils.logging_jar + \
os.pathsep + phoenix_utils.phoenix_client_embedded_jar + \
'"
-Djava.util.logging.config.class=org.apache.hadoop.hbase.logging.JulToSlf4jInitializer
' + \
- ' -Dlog4j2.configurationFile=file:' + \
- os.path.join(phoenix_utils.current_dir, "log4j2.properties") + \
+ ('' if '-Dlog4j2.configurationFile' in opts else '
-Dlog4j2.configurationFile=file:'
+ + os.path.join(phoenix_utils.current_dir, "log4j2.properties")) + \
" org.apache.phoenix.util.PhoenixRuntime " + args
print(java_cmd)
diff --git a/bin/sqlline.py b/bin/sqlline.py
index a45ed68c8c..09424789de 100755
--- a/bin/sqlline.py
+++ b/bin/sqlline.py
@@ -90,8 +90,10 @@ if os.uname()[4].startswith('ppc'):
else:
disable_jna = ""
+opts = os.getenv('PHOENIX_OPTS') or os.getenv('HBASE_OPTS') or ''
+
java_cmd = phoenix_utils.java + ' ' + phoenix_utils.jvm_module_flags + \
- ' $HBASE_OPTS $PHOENIX_OPTS ' + \
+ ' ' + opts + \
' -cp "' + phoenix_utils.hbase_conf_dir + os.pathsep + \
phoenix_utils.hadoop_conf + os.pathsep + \
phoenix_utils.sqlline_with_deps_jar + os.pathsep + \
@@ -99,7 +101,8 @@ java_cmd = phoenix_utils.java + ' ' +
phoenix_utils.jvm_module_flags + \
phoenix_utils.logging_jar + os.pathsep + \
phoenix_utils.phoenix_client_lite_jar + \
'"
-Djava.util.logging.config.class=org.apache.hadoop.hbase.logging.JulToSlf4jInitializer
' + \
- ' -Dlog4j2.configurationFile=file:' +
os.path.join(phoenix_utils.current_dir, "log4j2.properties") + \
+ ('' if '-Dlog4j2.configurationFile' in opts else '
-Dlog4j2.configurationFile=file:'
+ + os.path.join(phoenix_utils.current_dir, "log4j2.properties")) + \
disable_jna + \
" sqlline.SqlLine -d org.apache.phoenix.jdbc.PhoenixDriver" + \
(not args.noconnect and " -u " + phoenix_utils.shell_quote([jdbc_url]) or
"") + \