You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2022/11/09 15:20:09 UTC

[hbase] branch HBASE-27475 created (now ee4599d0438)

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

zhangduo pushed a change to branch HBASE-27475
in repository https://gitbox.apache.org/repos/asf/hbase.git


      at ee4599d0438 HBASE-27475 Use different jdks when running hadoopcheck in personality scripts

This branch includes the following new commits:

     new ee4599d0438 HBASE-27475 Use different jdks when running hadoopcheck in personality scripts

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[hbase] 01/01: HBASE-27475 Use different jdks when running hadoopcheck in personality scripts

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch HBASE-27475
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit ee4599d043830993ddc0df70c20334e523f2a12d
Author: Duo Zhang <zh...@apache.org>
AuthorDate: Wed Nov 9 23:19:40 2022 +0800

    HBASE-27475 Use different jdks when running hadoopcheck in personality scripts
---
 dev-support/Jenkinsfile                       |  3 ++-
 dev-support/Jenkinsfile_GitHub                |  1 +
 dev-support/hbase-personality.sh              | 13 ++++++++++++-
 dev-support/hbase_nightly_yetus.sh            |  4 ++++
 dev-support/jenkins_precommit_github_yetus.sh |  3 +++
 5 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile
index 8bbb00ebbb9..6d4a00d1dd3 100644
--- a/dev-support/Jenkinsfile
+++ b/dev-support/Jenkinsfile
@@ -39,7 +39,7 @@ pipeline {
     OUTPUT_DIR_RELATIVE_JDK11_HADOOP3 = 'output-jdk11-hadoop3'
 
     PROJECT = 'hbase'
-    PROJECT_PERSONALITY = 'https://raw.githubusercontent.com/apache/hbase/master/dev-support/hbase-personality.sh'
+    PROJECT_PERSONALITY = 'https://raw.githubusercontent.com/apache/hbase/HBASE-27475/dev-support/hbase-personality.sh'
     PERSONALITY_FILE = 'tools/personality.sh'
     // This section of the docs tells folks not to use the javadoc tag. older branches have our old version of the check for said tag.
     AUTHOR_IGNORE_LIST = 'src/main/asciidoc/_chapters/developer.adoc,dev-support/test-patch.sh'
@@ -203,6 +203,7 @@ pipeline {
             BASEDIR = "${env.WORKSPACE}/component"
             TESTS = "${env.SHALLOW_CHECKS}"
             SET_JAVA_HOME = "/usr/lib/jvm/java-11"
+            JAVA8_HOME="/usr/lib/jvm/java-8"
             // Activates hadoop 3.0 profile in maven runs.
             HADOOP_PROFILE = '3.0'
             OUTPUT_DIR_RELATIVE = "${env.OUTPUT_DIR_RELATIVE_GENERAL}"
diff --git a/dev-support/Jenkinsfile_GitHub b/dev-support/Jenkinsfile_GitHub
index ac548757df2..6eafddb6802 100644
--- a/dev-support/Jenkinsfile_GitHub
+++ b/dev-support/Jenkinsfile_GitHub
@@ -79,6 +79,7 @@ pipeline {
                         // customized per parallel stage
                         PLUGINS = "${GENERAL_CHECK_PLUGINS}"
                         SET_JAVA_HOME = "/usr/lib/jvm/java-11"
+                        JAVA8_HOME="/usr/lib/jvm/java-8"
                         WORKDIR_REL = "${WORKDIR_REL_GENERAL_CHECK}"
                         // identical for all parallel stages
                         WORKDIR = "${WORKSPACE}/${WORKDIR_REL}"
diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh
index 5f18b4652af..1f8e549201b 100755
--- a/dev-support/hbase-personality.sh
+++ b/dev-support/hbase-personality.sh
@@ -131,6 +131,10 @@ function personality_parse_args
         delete_parameter "${i}"
         SUREFIRE_SECOND_PART_FORK_COUNT=${i#*=}
       ;;
+      --java8-home=*)
+        delete_parameter "${i}"
+        JAVA8_HOME=${i#*=}
+      ;;
     esac
   done
 }
@@ -560,6 +564,7 @@ function hadoopcheck_rebuild
   local result=0
   local hbase_hadoop2_versions
   local hbase_hadoop3_versions
+  local savejavahome=${JAVA_HOME}
 
   if [[ "${repostatus}" = branch ]]; then
     return 0
@@ -582,7 +587,7 @@ function hadoopcheck_rebuild
     else
       hbase_hadoop2_versions="2.10.0 2.10.1 2.10.2"
     fi
-  elif [[ "${PATCH_BRANCH}" = branch-2.* ]]; then
+  elif [[ "${PATCH_BRANCH}" = branch-2.* ]] || [[ "${PATCH_BRANCH}" == "HBASE-27475" ]]; then
     yetus_info "Setting Hadoop 2 versions to test based on branch-2.5+ rules."
     hbase_hadoop2_versions="2.10.2"
   else
@@ -609,12 +614,18 @@ function hadoopcheck_rebuild
   export MAVEN_OPTS="${MAVEN_OPTS}"
   for hadoopver in ${hbase_hadoop2_versions}; do
     logfile="${PATCH_DIR}/patch-javac-${hadoopver}.txt"
+    # alawys use java8 to build with hadoop 2.x
+    if [[ -n "${JAVA8_HOME}" ]]; then
+      yetus_info "Switching to java 8 for building against hadoop 2.x"
+      export JAVA_HOME=${JAVA8_HOME}
+    fi
     # disabled because "maven_executor" needs to return both command and args
     # shellcheck disable=2046
     echo_and_redirect "${logfile}" \
       $(maven_executor) clean install \
         -DskipTests -DHBasePatchProcess \
         -Dhadoop-two.version="${hadoopver}"
+    export JAVA_HOME=${savejavahome}
     count=$(${GREP} -c '\[ERROR\]' "${logfile}")
     if [[ ${count} -gt 0 ]]; then
       add_vote_table -1 hadoopcheck "${BUILDMODEMSG} causes ${count} errors with Hadoop v${hadoopver}."
diff --git a/dev-support/hbase_nightly_yetus.sh b/dev-support/hbase_nightly_yetus.sh
index 3fb1ac7bfce..d824412835c 100755
--- a/dev-support/hbase_nightly_yetus.sh
+++ b/dev-support/hbase_nightly_yetus.sh
@@ -101,6 +101,10 @@ if [[ -n "${ASF_NIGHTLIES_GENERAL_CHECK_BASE}" ]]; then
   YETUS_ARGS=("--asf-nightlies-general-check-base=${ASF_NIGHTLIES_GENERAL_CHECK_BASE}" "${YETUS_ARGS[@]}")
 fi
 
+if [[ -n "${JAVA8_HOME}" ]]; then
+  YETUS_ARGS=("--java8-home=${JAVA8_HOME}" "${YETUS_ARGS[@]}")
+fi
+
 if [[ true !=  "${USE_YETUS_PRERELEASE}" ]]; then
   YETUS_ARGS=("--shelldocs=${WORKSPACE}/yetus-${YETUS_RELEASE}/bin/shelldocs" "${YETUS_ARGS[@]}")
   TESTPATCHBIN="${WORKSPACE}/yetus-${YETUS_RELEASE}/bin/test-patch"
diff --git a/dev-support/jenkins_precommit_github_yetus.sh b/dev-support/jenkins_precommit_github_yetus.sh
index c3da3263556..f5a7315b2d2 100755
--- a/dev-support/jenkins_precommit_github_yetus.sh
+++ b/dev-support/jenkins_precommit_github_yetus.sh
@@ -157,6 +157,9 @@ fi
 if [[ -n "${SUREFIRE_SECOND_PART_FORK_COUNT}" ]]; then
   YETUS_ARGS+=("--surefire-second-part-fork-count=${SUREFIRE_SECOND_PART_FORK_COUNT}")
 fi
+if [[ -n "${JAVA8_HOME}" ]]; then
+  YETUS_ARGS+=("--java8-home=${JAVA8_HOME}")
+fi
 
 echo "Launching yetus with command line:"
 echo "${TESTPATCHBIN} ${YETUS_ARGS[*]}"