Skip to content

Commit d10c2b5

Browse files
authored
HBASE-29159 The condition for testing whether we have hadoop jars in assembly is incorrect (#6741)
Signed-off-by: Istvan Toth <[email protected]>
1 parent 984f127 commit d10c2b5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bin/hbase

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,19 @@ if [ -d "$HBASE_HOME/hbase-server/target/hbase-webapps" ]; then
215215
fi
216216
fi
217217

218-
#If avail, add Hadoop to the CLASSPATH and to the JAVA_LIBRARY_PATH
218+
# If available, add Hadoop to the CLASSPATH and to the JAVA_LIBRARY_PATH
219219
# Allow this functionality to be disabled
220220
if [ "$HBASE_DISABLE_HADOOP_CLASSPATH_LOOKUP" != "true" ] ; then
221221
HADOOP_IN_PATH=$(PATH="${HADOOP_HOME:-${HADOOP_PREFIX}}/bin:$PATH" which hadoop 2>/dev/null)
222222
fi
223223

224-
#If Hadoop is not specified with HADOOP_HOME, check that the assembly includes Hadoop
225-
if [[ $in_dev_env = false && -z "${HADOOP_IN_PATH}" && ! -e "${HBASE_HOME}/lib/hadoop-common*" ]] ; then
224+
# Check if hadoop jars are available
225+
has_hadoop_jars=false
226+
if ls "${HBASE_HOME}"/lib/hadoop-common* &>/dev/null; then
227+
has_hadoop_jars=true
228+
fi
229+
230+
if [[ $in_dev_env = false && -z "${HADOOP_IN_PATH}" && $has_hadoop_jars = false ]] ; then
226231
echo Installation does not contain Hadoop, and HADOOP_HOME does not point to a Hadoop installation.
227232
echo Specify a compatible Hadoop installation via HADOOP_HOME, or use the HBase assembly variant
228233
echo that includes Hadoop.

0 commit comments

Comments
 (0)