You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by mi...@apache.org on 2018/05/01 21:30:09 UTC

impala git commit: Warn about Hadoop / Java version incompatibility

Repository: impala
Updated Branches:
  refs/heads/master 671de258f -> 52a2d90f9


Warn about Hadoop / Java version incompatibility

Running Hadoop 3 with Java 7 can result in some obscure error messages.
This change adds a warning to impala-config.sh when using Hadoop 3 with
Java 7.

   Your development environment is configured for Hadoop 3 and Java 7.
   Hadoop 3 requires at least Java 8. Your JAVA binary currently points
   to /usr/lib/jvm/java-7-oracle-amd64/bin/java and reports the
   following version:

   java version "1.7.0_75"
   Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
   Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)

It also catches failure of the minicluster start and prints an
additional warning when running with Hadoop 3 and Java 7.

Cherry-picks: not for 2.x

Change-Id: I4d8b505cf045eeb562d16ce4ce09da0712dc03eb
Reviewed-on: http://gerrit.cloudera.org:8080/10244
Reviewed-by: Michael Brown <mi...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/52a2d90f
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/52a2d90f
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/52a2d90f

Branch: refs/heads/master
Commit: 52a2d90f980dd360946c37284280de09cf5fab39
Parents: 671de25
Author: Lars Volker <lv...@cloudera.com>
Authored: Thu Apr 26 10:16:40 2018 -0700
Committer: Impala Public Jenkins <im...@cloudera.com>
Committed: Tue May 1 20:40:28 2018 +0000

----------------------------------------------------------------------
 bin/impala-config.sh         | 16 ++++++++++++++++
 testdata/bin/run-mini-dfs.sh | 19 +++++++++++++++++++
 2 files changed, 35 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/52a2d90f/bin/impala-config.sh
----------------------------------------------------------------------
diff --git a/bin/impala-config.sh b/bin/impala-config.sh
index 88a5dda..6404c57 100755
--- a/bin/impala-config.sh
+++ b/bin/impala-config.sh
@@ -681,3 +681,19 @@ else
   unset `grep export "${MINIKDC_ENV}" | sed "s/.*export \([^=]*\)=.*/\1/" \
       | sort | uniq`
 fi
+
+if [[ $IMPALA_MINICLUSTER_PROFILE_OVERRIDE == 3 ]]; then
+  # Check for minimum required Java version
+  # Only issue Java version warning when running Java 7.
+  if $JAVA -version 2>&1 | grep -q 'java version "1.7'; then
+    cat << EOF
+
+WARNING: Your development environment is configured for Hadoop 3 and Java 7. Hadoop 3
+requires at least Java 8. Your JAVA binary currently points to $JAVA
+and reports the following version:
+
+EOF
+    $JAVA -version
+    echo
+  fi
+fi

http://git-wip-us.apache.org/repos/asf/impala/blob/52a2d90f/testdata/bin/run-mini-dfs.sh
----------------------------------------------------------------------
diff --git a/testdata/bin/run-mini-dfs.sh b/testdata/bin/run-mini-dfs.sh
index 353ed0e..aefa703 100755
--- a/testdata/bin/run-mini-dfs.sh
+++ b/testdata/bin/run-mini-dfs.sh
@@ -37,4 +37,23 @@ if $SHOULD_FORMAT; then
   $IMPALA_HOME/testdata/cluster/admin delete_data
 fi
 
+set +e
 $IMPALA_HOME/testdata/cluster/admin start_cluster
+if [[ $? != 0 ]]; then
+  # Don't issue Java version warning when not running Hadoop 3.
+  [[ $IMPALA_MINICLUSTER_PROFILE != 3 ]] && exit 1
+
+  # Only issue Java version warning when running Java 7.
+  $JAVA -version 2>&1 | grep -q 'java version "1.7' || exit 1
+
+  cat << EOF
+
+Start of the minicluster failed. If the error looks similar to
+"Unsupported major.minor version 52.0", make sure you are running at least Java 8.
+Your JAVA binary currently points to $JAVA and reports the following version:
+
+EOF
+  $JAVA -version
+  echo
+  exit 1
+fi