You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by st...@apache.org on 2021/01/14 18:41:27 UTC

[phoenix] branch master updated: PHOENIX-6313 Rebuild HBase in Yetus

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 9d171c0  PHOENIX-6313 Rebuild HBase in Yetus
9d171c0 is described below

commit 9d171c0b6b940bff6632a11811f6a802df1f0f9c
Author: Istvan Toth <st...@apache.org>
AuthorDate: Thu Jan 14 11:29:42 2021 +0100

    PHOENIX-6313 Rebuild HBase in Yetus
---
 dev/phoenix-personality.sh | 33 ++++++++++++++++++++++++++++++++-
 dev/rebuild_hbase.sh       | 40 +++++++++++++++++++++++++++++++---------
 2 files changed, 63 insertions(+), 10 deletions(-)

diff --git a/dev/phoenix-personality.sh b/dev/phoenix-personality.sh
index 692981e..618f69b 100755
--- a/dev/phoenix-personality.sh
+++ b/dev/phoenix-personality.sh
@@ -146,7 +146,7 @@ function personality_modules
   fi
 
   # If we have HBASE_PROFILE specified pass along
-  # the hadoop.profile system property.
+  # the hbase.profile system property.
   if [[ -n "${HBASE_PROFILE}" ]] ; then
     extra="${extra} -Dhbase.profile=${HBASE_PROFILE}"
   fi
@@ -298,6 +298,37 @@ function get_include_exclude_tests_arg
 
 ######################################
 
+add_test_type hbaserebuild
+
+## @description  hbaserebuild file filter
+## @audience     private
+## @stability    evolving
+## @param        filename
+function hbaserebuild_filefilter
+{
+  local filename=$1
+
+  if [[ ${filename} =~ \.java$ ]]; then
+    add_test hbaserebuild
+  fi
+}
+
+## @description  hbaserebuild precheck
+## @audience     private
+## @stability    evolving
+## @param        none
+function hbaserebuild_precompile
+{
+  big_console_header "Reinstalling HBase with Hadoop 3"
+
+  MAVEN_LOCAL_REPO="$MAVEN_LOCAL_REPO" ${BASEDIR}/dev/rebuild_hbase.sh detect
+
+  add_vote_table +0 hbaserecompile "" "HBase recompiled."
+  return 0
+}
+
+######################################
+
 add_test_type hbaseanti
 
 ## @description  hbaseanti file filter
diff --git a/dev/rebuild_hbase.sh b/dev/rebuild_hbase.sh
index e4c9211..2e7bc40 100755
--- a/dev/rebuild_hbase.sh
+++ b/dev/rebuild_hbase.sh
@@ -14,10 +14,34 @@
 # Rebuilds HBase with -Dhadoop.profile=3.0 locally, to work around PHOENIX-5993
 # Intended mainly for CI jobs, but can simplify manual rebuilds as well.
 
+
+DEV_SUPPORT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+ARTIFACTS_DIR="$DEV_SUPPORT/artifacts"
+WORK_DIR="$DEV_SUPPORT/work"
+
+if [[ ! -z "$MAVEN_SETTINGS_FILE" ]]; then
+  SETTINGS=( "--settings" "$MAVEN_SETTINGS_FILE" )
+fi
+
+if [[ ! -z "$MAVEN_LOCAL_REPO" ]]; then
+  LOCALREPO="-Dmaven.repo.local=${MAVEN_LOCAL_REPO}"
+fi
+
+if [[ "$1" == "detect" ]]; then
+  set -e
+  cd "$DEV_SUPPORT/.."
+  HBASE_VERSION=$(mvn ${SETTINGS[@]} help:evaluate -Dexpression=hbase.version -q -DforceStdout $LOCALREPO)
+  echo "HBASE_VERSION=$HBASE_VERSION"
+  cd "$DEV_SUPPORT"
+  set +e
+else
+  HBASE_VERSION="$1"
+fi
+
 # The name of the Apache Hbase source file
-HBASE_SOURCE_NAME="hbase-$1-src.tar.gz"
+HBASE_SOURCE_NAME="hbase-$HBASE_VERSION-src.tar.gz"
 # The relative path on the ASF mirrors for the Hbase source file
-HBASE_SOURCE_MIRROR_NAME="hbase/$1/$HBASE_SOURCE_NAME"
+HBASE_SOURCE_MIRROR_NAME="hbase/$HBASE_VERSION/$HBASE_SOURCE_NAME"
 
 # Downloads the specified HBase version source, extracts it,
 # then rebuilds and installs the maven artifacts locally with -Dhadoop.profile=3.0
@@ -27,10 +51,6 @@ if [ $# -ne 1 ]
     echo "Supply the Hbase version as paramater i.e.: rebuild_hbase.sh 2.2.6 "
 fi
 
-DEV_SUPPORT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
-ARTIFACTS_DIR="$DEV_SUPPORT/artifacts"
-WORK_DIR="$DEV_SUPPORT/work"
-
 mkdir "$ARTIFACTS_DIR"
 mkdir "$WORK_DIR"
 
@@ -39,7 +59,9 @@ $DEV_SUPPORT/cache-apache-project-artifact.sh --keys https://downloads.apache.or
 
 STARTDIR=$PWD
 cd $ARTIFACTS_DIR
-tar xfz hbase-$1-src.tar.gz
-cd hbase-$1
-mvn clean install -Dhadoop.profile=3.0 -DskipTests -B
+tar xfz hbase-$HBASE_VERSION-src.tar.gz
+cd hbase-$HBASE_VERSION
+echo mvn ${SETTINGS[@]} clean install -Dhadoop.profile=3.0 -DskipTests -B $LOCALREPO
+mvn ${SETTINGS[@]} clean install -Dhadoop.profile=3.0 -DskipTests -B $LOCALREPO
 cd ${STARTDIR}
+