This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new d10c2b5eaf9 HBASE-29159 The condition for testing whether we have
hadoop jars in assembly is incorrect (#6741)
d10c2b5eaf9 is described below
commit d10c2b5eaf9ec644106898cf3c7abb390c062a81
Author: Duo Zhang <[email protected]>
AuthorDate: Mon Mar 3 15:00:00 2025 +0800
HBASE-29159 The condition for testing whether we have hadoop jars in
assembly is incorrect (#6741)
Signed-off-by: Istvan Toth <[email protected]>
---
bin/hbase | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/bin/hbase b/bin/hbase
index 3ae615a700a..d8d9b6ec5b2 100755
--- a/bin/hbase
+++ b/bin/hbase
@@ -215,14 +215,19 @@ if [ -d "$HBASE_HOME/hbase-server/target/hbase-webapps"
]; then
fi
fi
-#If avail, add Hadoop to the CLASSPATH and to the JAVA_LIBRARY_PATH
+# If available, add Hadoop to the CLASSPATH and to the JAVA_LIBRARY_PATH
# Allow this functionality to be disabled
if [ "$HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP" != "true" ] ; then
HADOOP_IN_PATH=$(PATH="${HADOOP_HOME:-${HADOOP_PREFIX}}/bin:$PATH" which
hadoop 2>/dev/null)
fi
-#If Hadoop is not specified with HADOOP_HOME, check that the assembly includes
Hadoop
-if [[ $in_dev_env = false && -z "${HADOOP_IN_PATH}" && ! -e
"${HBASE_HOME}/lib/hadoop-common*" ]] ; then
+# Check if hadoop jars are available
+has_hadoop_jars=false
+if ls "${HBASE_HOME}"/lib/hadoop-common* &>/dev/null; then
+ has_hadoop_jars=true
+fi
+
+if [[ $in_dev_env = false && -z "${HADOOP_IN_PATH}" && $has_hadoop_jars =
false ]] ; then
echo Installation does not contain Hadoop, and HADOOP_HOME does not point to
a Hadoop installation.
echo Specify a compatible Hadoop installation via HADOOP_HOME, or use the
HBase assembly variant
echo that includes Hadoop.