incubator-hawq git commit: HAWQ-326. Fix specified HAWQ_RELEASE_VERSION for rpm build.

2017-03-28 Thread rlei
Repository: incubator-hawq
Updated Branches:
  refs/heads/master dc41e4c51 -> 2761edb60


HAWQ-326. Fix specified HAWQ_RELEASE_VERSION for rpm build.

This fix included:
  1) Fixed HAWQ_RELEASE_VERSION for rpm tarball.
  2) Make sure distclean delete all the rpm artifacts.
  3) Added some log output.
  4) Fix exit status


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/2761edb6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/2761edb6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/2761edb6

Branch: refs/heads/master
Commit: 2761edb60e48290fa011e141d544f8770dbc56c9
Parents: dc41e4c
Author: rlei 
Authored: Tue Mar 28 22:19:29 2017 +0800
Committer: rlei 
Committed: Wed Mar 29 13:26:20 2017 +0800

--
 GNUmakefile.in|  1 +
 contrib/Makefile  |  1 +
 contrib/hawq-package/build_hawq_rpm.sh| 15 +--
 contrib/hawq-package/make_rpm_tarball.sh  | 23 +--
 pxf/Makefile  |  3 +++
 ranger-plugin/scripts/build_ranger_rpm.sh |  6 +++---
 6 files changed, 34 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2761edb6/GNUmakefile.in
--
diff --git a/GNUmakefile.in b/GNUmakefile.in
index 8ac58e3..5e97160 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -88,6 +88,7 @@ distclean maintainer-clean:
-$(MAKE) -C tools $@
-$(MAKE) -C src feature-test-clean
-$(MAKE) -C src $@
+   -$(MAKE) -C pxf $@
-$(MAKE) -C ranger-plugin $@
-rm -f config.cache config.log config.status GNUmakefile
 # Garbage from autoconf:

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2761edb6/contrib/Makefile
--
diff --git a/contrib/Makefile b/contrib/Makefile
index a75d930..695e92a 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -28,6 +28,7 @@ clean distclean maintainer-clean:
@for dir in $(WANTED_DIRS); do \
$(MAKE) -C $$dir $@ || true; \
done
+   $(MAKE) -C hawq-package $@
 
 # We'd like check operations to run all the subtests before failing.
 check installcheck: pgcrypto_prepare

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2761edb6/contrib/hawq-package/build_hawq_rpm.sh
--
diff --git a/contrib/hawq-package/build_hawq_rpm.sh 
b/contrib/hawq-package/build_hawq_rpm.sh
index 5385aff..c3c3309 100755
--- a/contrib/hawq-package/build_hawq_rpm.sh
+++ b/contrib/hawq-package/build_hawq_rpm.sh
@@ -54,9 +54,14 @@ fi
 
 # Copy HAWQ source code tarball for rpm build
 if [ -f "${HAWQ_SOURCE_TARBALL_PATH}/${HAWQ_SOURCE_TARBALL_FILE}" ]; then
+echo "Using HAWQ source code tarball: 
${HAWQ_SOURCE_TARBALL_PATH}/${HAWQ_SOURCE_TARBALL_FILE}"
 cp ${HAWQ_SOURCE_TARBALL_PATH}/${HAWQ_SOURCE_TARBALL_FILE} 
rpmbuild/SOURCES/
 else
-echo "Can not find ${HAWQ_SOURCE_TARBALL_PATH}/${HAWQ_SOURCE_TARBALL_FILE} 
"
+echo 
"="
+echo "Can not find ${HAWQ_SOURCE_TARBALL_PATH}/${HAWQ_SOURCE_TARBALL_FILE}"
+echo "Please copy the source code tarball in place."
+echo "Or use environment variable 'HAWQ_SOURCE_TARBALL_PATH' to specify 
the find path of HAWQ source tarball."
+echo 
"="
 exit 1
 fi
 
@@ -71,8 +76,14 @@ rpmbuild --define "_topdir ${RPM_TOP_DIR}" \
  -bb SPECS/hawq.spec
 if [ $? != 0 ]; then
 echo "Build HAWQ rpm package failed, exit..."
-exit 0
+exit $?
 fi
 
 set +x
 popd > /dev/null
+
+echo 
"="
+echo "Build HAWQ rpm package successfully."
+echo 
"="
+echo ""
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2761edb6/contrib/hawq-package/make_rpm_tarball.sh
--
diff --git a/contrib/hawq-package/make_rpm_tarball.sh 
b/contrib/hawq-package/make_rpm_tarball.sh
index 90895b7..ba0c4f7 100755
--- a/contrib/hawq-package/make_rpm_tarball.sh
+++ b/contrib/hawq-package/make_rpm_tarball.sh
@@ -19,7 +19,9 @@
 CUR_DIR=$(pwd)
 SRC_TOP_DIR=../..
 
-HAWQ_RELEASE_VERSION=$(cat ../../getversion| grep ^GP_VERSION | cut -d '=' -f2 
| sed 's|"||g' | cut -d '-' -f1)
+if [ -z  "${HAWQ_RELEASE_VERSION}" ]; then
+HAWQ_RELEASE_VERSION=$(cat ../../getversion| grep ^GP_VERSION | cut -d '=' 
-f2 | sed 's|"||g' | cut -d '-' -f1)

incubator-hawq git commit: HAWQ-1415. Set the default_value of JAVA_HOME for running RPS (closes #1206).

2017-03-28 Thread espino
Repository: incubator-hawq
Updated Branches:
  refs/heads/2.2.0.0-incubating fe6c0e9c8 -> dc41e4c51


HAWQ-1415. Set the default_value of JAVA_HOME for running RPS (closes #1206).


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/dc41e4c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/dc41e4c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/dc41e4c5

Branch: refs/heads/2.2.0.0-incubating
Commit: dc41e4c5131351a5260788e14f6cebd611e4762a
Parents: fe6c0e9
Author: ljainpivotalio 
Authored: Tue Mar 28 19:05:52 2017 -0700
Committer: Ed Espino 
Committed: Tue Mar 28 20:03:41 2017 -0700

--
 ranger-plugin/conf/rps.properties |  3 +++
 ranger-plugin/scripts/enable-ranger-plugin.sh | 25 +-
 ranger-plugin/scripts/rps.sh  |  1 +
 3 files changed, 28 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dc41e4c5/ranger-plugin/conf/rps.properties
--
diff --git a/ranger-plugin/conf/rps.properties 
b/ranger-plugin/conf/rps.properties
index 81a6986..7565885 100644
--- a/ranger-plugin/conf/rps.properties
+++ b/ranger-plugin/conf/rps.properties
@@ -36,3 +36,6 @@ RPS_HEAP_SIZE=128m
 
 # use CATALINA_HOME in default and use /usr/lib/bigtop-tomcat if CATALINA_HOME 
not set
 CATALINA_HOME=${CATALINA_HOME:-/usr/lib/bigtop-tomcat}
+
+# use JAVA_HOME in default and use /usr/java/default if JAVA_HOME not set
+JAVA_HOME=${JAVA_HOME:-/usr/java/default}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dc41e4c5/ranger-plugin/scripts/enable-ranger-plugin.sh
--
diff --git a/ranger-plugin/scripts/enable-ranger-plugin.sh 
b/ranger-plugin/scripts/enable-ranger-plugin.sh
index 05a0b1d..2fa7162 100755
--- a/ranger-plugin/scripts/enable-ranger-plugin.sh
+++ b/ranger-plugin/scripts/enable-ranger-plugin.sh
@@ -150,7 +150,7 @@ function validate_params() {
   get_hawq_password
   echo "RANGER URL  = ${RANGER_URL}" 
   echo "RANGER User = ${RANGER_USER}" 
-  echo "RANGER Password = $(mask ${RANGER_PASSWORD})" 
+  echo "RANGER Password = $(mask ${RANGER_PASSWORD})"
   echo "HAWQ HOST = ${HAWQ_HOST}"
   echo "HAWQ PORT = ${HAWQ_PORT}"  
   echo "HAWQ User = ${HAWQ_USER}" 
@@ -211,6 +211,28 @@ function update_ranger_url() {
   echo "Updated POLICY_MGR_URL to ${policy_mgr_url} in ${prop_file}"
 }
 
+function update_java_home() {
+  local jdk64="/usr/jdk64"
+  local java_sdk="/etc/alternatives/java_sdk"
+
+  if [[ -d ${jdk64} ]]; then
+local DIR_NAME=$(ls ${jdk64} | sort -r | head -1)
+if [[ ${DIR_NAME} ]]; then
+  JAVA_HOME_DIR="${jdk64}/${DIR_NAME}"
+fi
+  elif [[ -d ${java_sdk} ]]; then
+JAVA_HOME_DIR="${java_sdk}"
+  fi
+
+  if [[ ${JAVA_HOME_DIR} ]]; then
+local prop_file=$(dirname ${SCRIPT_DIR})/etc/rps.properties
+sed -i -e "s|/usr/java/default|${JAVA_HOME_DIR}|g" ${prop_file}
+echo "Updated default value of JAVA_HOME to ${JAVA_HOME_DIR} in 
${prop_file}"
+  elif [[ ! ${JAVA_HOME} ]]; then
+echo "Unable to locate JAVA_HOME on this machine. Please modify the 
default value of JAVA_HOME in ${prop_file}."
+  fi
+}
+
 main() {
   if [[ $# -lt 1 ]]; then
 usage
@@ -221,5 +243,6 @@ main() {
   create_hawq_service_definition
   create_hawq_service_instance
   update_ranger_url
+  update_java_home
 }
 main "$@"

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dc41e4c5/ranger-plugin/scripts/rps.sh
--
diff --git a/ranger-plugin/scripts/rps.sh b/ranger-plugin/scripts/rps.sh
index fa268c9..70aa547 100755
--- a/ranger-plugin/scripts/rps.sh
+++ b/ranger-plugin/scripts/rps.sh
@@ -32,6 +32,7 @@ BASEDIR=$( dirname ${CWDIR} )
 # read properties from the file
 source ${BASEDIR}/etc/rps.properties
 
+export JAVA_HOME
 export CATALINA_HOME
 export CATALINA_BASE=${BASEDIR}/plugin-service
 export CATALINA_PID=${CATALINA_BASE}/work/rps.pid



incubator-hawq git commit: HAWQ-1415. Set the default_value of JAVA_HOME for running RPS (closes #1206).

2017-03-28 Thread espino
Repository: incubator-hawq
Updated Branches:
  refs/heads/master fe6c0e9c8 -> dc41e4c51


HAWQ-1415. Set the default_value of JAVA_HOME for running RPS (closes #1206).


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/dc41e4c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/dc41e4c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/dc41e4c5

Branch: refs/heads/master
Commit: dc41e4c5131351a5260788e14f6cebd611e4762a
Parents: fe6c0e9
Author: ljainpivotalio 
Authored: Tue Mar 28 19:05:52 2017 -0700
Committer: Ed Espino 
Committed: Tue Mar 28 20:03:41 2017 -0700

--
 ranger-plugin/conf/rps.properties |  3 +++
 ranger-plugin/scripts/enable-ranger-plugin.sh | 25 +-
 ranger-plugin/scripts/rps.sh  |  1 +
 3 files changed, 28 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dc41e4c5/ranger-plugin/conf/rps.properties
--
diff --git a/ranger-plugin/conf/rps.properties 
b/ranger-plugin/conf/rps.properties
index 81a6986..7565885 100644
--- a/ranger-plugin/conf/rps.properties
+++ b/ranger-plugin/conf/rps.properties
@@ -36,3 +36,6 @@ RPS_HEAP_SIZE=128m
 
 # use CATALINA_HOME in default and use /usr/lib/bigtop-tomcat if CATALINA_HOME 
not set
 CATALINA_HOME=${CATALINA_HOME:-/usr/lib/bigtop-tomcat}
+
+# use JAVA_HOME in default and use /usr/java/default if JAVA_HOME not set
+JAVA_HOME=${JAVA_HOME:-/usr/java/default}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dc41e4c5/ranger-plugin/scripts/enable-ranger-plugin.sh
--
diff --git a/ranger-plugin/scripts/enable-ranger-plugin.sh 
b/ranger-plugin/scripts/enable-ranger-plugin.sh
index 05a0b1d..2fa7162 100755
--- a/ranger-plugin/scripts/enable-ranger-plugin.sh
+++ b/ranger-plugin/scripts/enable-ranger-plugin.sh
@@ -150,7 +150,7 @@ function validate_params() {
   get_hawq_password
   echo "RANGER URL  = ${RANGER_URL}" 
   echo "RANGER User = ${RANGER_USER}" 
-  echo "RANGER Password = $(mask ${RANGER_PASSWORD})" 
+  echo "RANGER Password = $(mask ${RANGER_PASSWORD})"
   echo "HAWQ HOST = ${HAWQ_HOST}"
   echo "HAWQ PORT = ${HAWQ_PORT}"  
   echo "HAWQ User = ${HAWQ_USER}" 
@@ -211,6 +211,28 @@ function update_ranger_url() {
   echo "Updated POLICY_MGR_URL to ${policy_mgr_url} in ${prop_file}"
 }
 
+function update_java_home() {
+  local jdk64="/usr/jdk64"
+  local java_sdk="/etc/alternatives/java_sdk"
+
+  if [[ -d ${jdk64} ]]; then
+local DIR_NAME=$(ls ${jdk64} | sort -r | head -1)
+if [[ ${DIR_NAME} ]]; then
+  JAVA_HOME_DIR="${jdk64}/${DIR_NAME}"
+fi
+  elif [[ -d ${java_sdk} ]]; then
+JAVA_HOME_DIR="${java_sdk}"
+  fi
+
+  if [[ ${JAVA_HOME_DIR} ]]; then
+local prop_file=$(dirname ${SCRIPT_DIR})/etc/rps.properties
+sed -i -e "s|/usr/java/default|${JAVA_HOME_DIR}|g" ${prop_file}
+echo "Updated default value of JAVA_HOME to ${JAVA_HOME_DIR} in 
${prop_file}"
+  elif [[ ! ${JAVA_HOME} ]]; then
+echo "Unable to locate JAVA_HOME on this machine. Please modify the 
default value of JAVA_HOME in ${prop_file}."
+  fi
+}
+
 main() {
   if [[ $# -lt 1 ]]; then
 usage
@@ -221,5 +243,6 @@ main() {
   create_hawq_service_definition
   create_hawq_service_instance
   update_ranger_url
+  update_java_home
 }
 main "$@"

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dc41e4c5/ranger-plugin/scripts/rps.sh
--
diff --git a/ranger-plugin/scripts/rps.sh b/ranger-plugin/scripts/rps.sh
index fa268c9..70aa547 100755
--- a/ranger-plugin/scripts/rps.sh
+++ b/ranger-plugin/scripts/rps.sh
@@ -32,6 +32,7 @@ BASEDIR=$( dirname ${CWDIR} )
 # read properties from the file
 source ${BASEDIR}/etc/rps.properties
 
+export JAVA_HOME
 export CATALINA_HOME
 export CATALINA_BASE=${BASEDIR}/plugin-service
 export CATALINA_PID=${CATALINA_BASE}/work/rps.pid



incubator-hawq-docs git commit: hawq state ref page - add ranger status to info

2017-03-28 Thread lisao
Repository: incubator-hawq-docs
Updated Branches:
  refs/heads/feature/ranger-integration d981a9596 -> a886ae32c


hawq state ref page - add ranger status to info


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq-docs/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-hawq-docs/commit/a886ae32
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq-docs/tree/a886ae32
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq-docs/diff/a886ae32

Branch: refs/heads/feature/ranger-integration
Commit: a886ae32c93c1130fd1611254ddd656c3dd783ff
Parents: d981a95
Author: Lisa Owen 
Authored: Tue Mar 28 16:04:50 2017 -0700
Committer: Lisa Owen 
Committed: Tue Mar 28 16:04:50 2017 -0700

--
 markdown/reference/cli/admin_utilities/hawqstate.html.md.erb | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq-docs/blob/a886ae32/markdown/reference/cli/admin_utilities/hawqstate.html.md.erb
--
diff --git a/markdown/reference/cli/admin_utilities/hawqstate.html.md.erb 
b/markdown/reference/cli/admin_utilities/hawqstate.html.md.erb
index e56ecd1..a8c505f 100644
--- a/markdown/reference/cli/admin_utilities/hawqstate.html.md.erb
+++ b/markdown/reference/cli/admin_utilities/hawqstate.html.md.erb
@@ -43,6 +43,7 @@ The `hawq state` utility displays information about a running 
HAWQ instance. A H
 -   Master and segment configuration information (hosts, data directories, 
etc.).
 -   The ports used by the system.
 -   Whether a standby master is present, and if it is active.
+-   Whether Ranger authorization is enabled for HAWQ, and if so, the status of 
the HAWQ Ranger Plug-in Service.
 
 ## Options
 



[4/4] incubator-hawq git commit: HAWQ-1419. Run RPS service tests in separate JVMs

2017-03-28 Thread huor
HAWQ-1419. Run RPS service tests in separate JVMs

(this closes #1202)


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/fe6c0e9c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/fe6c0e9c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/fe6c0e9c

Branch: refs/heads/2.2.0.0-incubating
Commit: fe6c0e9c82d939dacc161bc15188aae0f7a48226
Parents: 1e9ea99
Author: Alexander Denissov 
Authored: Tue Mar 28 14:48:07 2017 -0700
Committer: Alexander Denissov 
Committed: Tue Mar 28 14:56:54 2017 -0700

--
 ranger-plugin/service/pom.xml | 9 +
 1 file changed, 9 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/fe6c0e9c/ranger-plugin/service/pom.xml
--
diff --git a/ranger-plugin/service/pom.xml b/ranger-plugin/service/pom.xml
index 500df1f..1633f68 100644
--- a/ranger-plugin/service/pom.xml
+++ b/ranger-plugin/service/pom.xml
@@ -61,6 +61,15 @@
 
 
 
+org.apache.maven.plugins
+maven-surefire-plugin
+2.19.1
+
+
+false
+
+
+
 maven-war-plugin
 3.0.0
 



[2/4] incubator-hawq git commit: HAWQ-1140. Rename yml file name and table name in TestUsage2Case1ErrorHashTableRegistry (close #1200)

2017-03-28 Thread huor
HAWQ-1140. Rename yml file name and table name in 
TestUsage2Case1ErrorHashTableRegistry
(close #1200)


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/46a9621b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/46a9621b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/46a9621b

Branch: refs/heads/2.2.0.0-incubating
Commit: 46a9621bb4b02e6932feb5bb0c07193e2812e66b
Parents: bbdcf95
Author: Chunling Wang 
Authored: Tue Mar 28 17:31:55 2017 +0800
Committer: Lili Ma 
Committed: Tue Mar 28 17:42:05 2017 +0800

--
 .../test_hawq_register_usage2_case1.cpp | 90 ++--
 1 file changed, 45 insertions(+), 45 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/46a9621b/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp
--
diff --git 
a/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp 
b/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp
index 3623528..997a549 100644
--- a/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp
+++ b/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp
@@ -214,51 +214,51 @@ TEST_F(TestHawqRegister, 
TestUsage2Case1HDFSFilePathContainErrorSymbol) {
 
 TEST_F(TestHawqRegister, TestUsage2Case1ErrorHashTableRegistry) {
 SQLUtility util;
-util.execute("drop table if exists t_1_1;");
-util.execute("drop table if exists t_1_2;");
-util.execute("drop table if exists t_1_3;");
-util.execute("drop table if exists t_2;");
-util.execute("drop table if exists nt_1;");
-util.execute("drop table if exists nt_2;");
-
-util.execute("create table t_1_1(i int, j int, k int) with 
(appendonly=true, orientation=row, bucketnum=12) distributed by (i, j);");
-util.execute("insert into t_1_1 select generate_series(1, 100);");
-util.query("select * from t_1_1;", 100);
-util.execute("create table t_1_2(i int, j int, k int) with 
(appendonly=true, orientation=row) distributed by (i);");
-util.execute("insert into t_1_2 select generate_series(1, 100);");
-util.query("select * from t_1_2;", 100);
-util.execute("create table t_1_3(i int, j int, k int) with 
(appendonly=true, orientation=row) distributed randomly;");
-util.execute("insert into t_1_3 select generate_series(1, 100);");
-util.query("select * from t_1_3;", 100);
-util.execute("create table t_2(i int, j int, k int) with (appendonly=true, 
orientation=row) distributed by (i);");
-util.execute("insert into t_2 select generate_series(1, 100);");
-util.query("select * from t_2;", 100);
-util.execute("create table nt_1(i int, j int, k int) with 
(appendonly=true, orientation=row) distributed by (i, j);");
-util.execute("insert into nt_1 select generate_series(1, 100);");
-util.query("select * from nt_1;", 100);
-util.execute("create table nt_2(i int, j int, k int) with 
(appendonly=true, orientation=row) distributed by (j);");
-util.execute("insert into nt_2 select generate_series(1, 100);");
-util.query("select * from nt_2;", 100);
-
-EXPECT_EQ(0, Command::getCommandStatus(hawq::test::stringFormat("hawq 
extract -d %s -o t_1_1.yml 
testhawqregister_testusage2case1errorhashtableregistry.t_1_1", HAWQ_DB)));
-EXPECT_EQ(1, Command::getCommandStatus(hawq::test::stringFormat("hawq 
register -d %s -c t_1_1.yml 
testhawqregister_testusage2case1errorhashtableregistry.nt_1", HAWQ_DB)));
-EXPECT_EQ(0, Command::getCommandStatus(hawq::test::stringFormat("hawq 
extract -d %s -o t_1_2.yml 
testhawqregister_testusage2case1errorhashtableregistry.t_1_2", HAWQ_DB)));
-EXPECT_EQ(1, Command::getCommandStatus(hawq::test::stringFormat("hawq 
register -d %s -c t_1_2.yml 
testhawqregister_testusage2case1errorhashtableregistry.nt_1", HAWQ_DB)));
-EXPECT_EQ(0, Command::getCommandStatus(hawq::test::stringFormat("hawq 
extract -d %s -o t_1_3.yml 
testhawqregister_testusage2case1errorhashtableregistry.t_1_3", HAWQ_DB)));
-EXPECT_EQ(1, Command::getCommandStatus(hawq::test::stringFormat("hawq 
register -d %s -c t_1_3.yml 
testhawqregister_testusage2case1errorhashtableregistry.nt_1", HAWQ_DB)));
-EXPECT_EQ(0, Command::getCommandStatus(hawq::test::stringFormat("hawq 
extract -d %s -o t_2.yml 
testhawqregister_testusage2case1errorhashtableregistry.t_2", HAWQ_DB)));
-EXPECT_EQ(1, Command::getCommandStatus(hawq::test::stringFormat("hawq 
register -d %s -c t_2.yml 
testhawqregister_testusage2case1errorhashtableregistry.nt_2", HAWQ_DB)));
-
-EXPECT_EQ(0, Command::getCommandStatus("rm -rf t_1_1.yml"));
-EXPECT_EQ(0, Command::getCommandStatus("rm -rf t_1_2.yml"));
-

[1/4] incubator-hawq git commit: HAWQ-1418. Print executing command for hawq register (close #1199)

2017-03-28 Thread huor
Repository: incubator-hawq
Updated Branches:
  refs/heads/2.2.0.0-incubating c2ba42026 -> fe6c0e9c8


HAWQ-1418. Print executing command for hawq register
(close #1199)


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/bbdcf95a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/bbdcf95a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/bbdcf95a

Branch: refs/heads/2.2.0.0-incubating
Commit: bbdcf95a02a93c12ef1e786437cdad77c515ffa7
Parents: c2ba420
Author: Chunling Wang 
Authored: Tue Mar 28 17:08:35 2017 +0800
Committer: Lili Ma 
Committed: Tue Mar 28 17:20:29 2017 +0800

--
 tools/bin/hawqregister | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/bbdcf95a/tools/bin/hawqregister
--
diff --git a/tools/bin/hawqregister b/tools/bin/hawqregister
index 39d0c23..e5c3f6a 100755
--- a/tools/bin/hawqregister
+++ b/tools/bin/hawqregister
@@ -34,6 +34,12 @@ except ImportError, e:
 sys.stderr.write('Cannot import module, please check that you have source 
greenplum_path.sh\n')
 sys.exit(2)
 
+# print executing command
+cmd = "Executing Command: ";
+for arg in sys.argv:
+cmd += arg + " "
+logger.info(cmd);
+
 # setup logging
 logger = get_default_logger()
 EXECNAME = os.path.split(__file__)[-1]



[3/4] incubator-hawq git commit: HAWQ-1418. Move print executing command after setup logging

2017-03-28 Thread huor
HAWQ-1418. Move print executing command after setup logging


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/1e9ea994
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/1e9ea994
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/1e9ea994

Branch: refs/heads/2.2.0.0-incubating
Commit: 1e9ea99458a251c3084e69147bdde2c19e702049
Parents: 46a9621
Author: Chunling Wang 
Authored: Tue Mar 28 18:15:00 2017 +0800
Committer: Chunling Wang 
Committed: Tue Mar 28 18:17:07 2017 +0800

--
 tools/bin/hawqregister | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1e9ea994/tools/bin/hawqregister
--
diff --git a/tools/bin/hawqregister b/tools/bin/hawqregister
index e5c3f6a..ff2bb96 100755
--- a/tools/bin/hawqregister
+++ b/tools/bin/hawqregister
@@ -34,17 +34,17 @@ except ImportError, e:
 sys.stderr.write('Cannot import module, please check that you have source 
greenplum_path.sh\n')
 sys.exit(2)
 
+# setup logging
+logger = get_default_logger()
+EXECNAME = os.path.split(__file__)[-1]
+setup_tool_logging(EXECNAME, getLocalHostname(), getUserName())
+
 # print executing command
 cmd = "Executing Command: ";
 for arg in sys.argv:
 cmd += arg + " "
 logger.info(cmd);
 
-# setup logging
-logger = get_default_logger()
-EXECNAME = os.path.split(__file__)[-1]
-setup_tool_logging(EXECNAME, getLocalHostname(), getUserName())
-
 def option_parser():
 '''option parser'''
 parser = OptParser(option_class=OptChecker,



incubator-hawq-docs git commit: initial checkin of policy doc; includes referenced img

2017-03-28 Thread lisao
Repository: incubator-hawq-docs
Updated Branches:
  refs/heads/feature/ranger-integration 70693401a -> d981a9596


initial checkin of policy doc; includes referenced img


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq-docs/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-hawq-docs/commit/d981a959
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq-docs/tree/d981a959
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq-docs/diff/d981a959

Branch: refs/heads/feature/ranger-integration
Commit: d981a95960b1b06879aa1e47e6e394d0ed40352b
Parents: 7069340
Author: Lisa Owen 
Authored: Tue Mar 28 15:48:44 2017 -0700
Committer: Lisa Owen 
Committed: Tue Mar 28 15:48:44 2017 -0700

--
 markdown/images/hawqpolicydetails.png   | Bin 0 -> 165359 bytes
 .../ranger/ranger-policy-creation.html.md.erb   | 486 +++
 2 files changed, 486 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq-docs/blob/d981a959/markdown/images/hawqpolicydetails.png
--
diff --git a/markdown/images/hawqpolicydetails.png 
b/markdown/images/hawqpolicydetails.png
new file mode 100644
index 000..4c7945f
Binary files /dev/null and b/markdown/images/hawqpolicydetails.png differ

http://git-wip-us.apache.org/repos/asf/incubator-hawq-docs/blob/d981a959/markdown/ranger/ranger-policy-creation.html.md.erb
--
diff --git a/markdown/ranger/ranger-policy-creation.html.md.erb 
b/markdown/ranger/ranger-policy-creation.html.md.erb
index 16573fb..f3b73f6 100644
--- a/markdown/ranger/ranger-policy-creation.html.md.erb
+++ b/markdown/ranger/ranger-policy-creation.html.md.erb
@@ -20,3 +20,489 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 -->
+
+Ranger secures your Hadoop services, providing a centralized console to manage 
user access to the data in your HAWQ cluster.
+
+Native HAWQ authorization provides SQL standard authorization at the database 
and table level for specific users/roles using `GRANT` and `REVOKE` SQL 
commands. HAWQ integration with Ranger provides policy-based authorization, 
enabling you to identify the conditions under which a user and/or group can 
access individual HAWQ resources, including the operations permitted on those 
resources. 
+
+**Note**: The HAWQ `GRANT` and `REVOKE` operations are not permitted when 
Ranger authorization is enabled for HAWQ; you must configure all user and 
object access through Ranger policies.
+
+You will configure HAWQ-Ranger authorization through the Ranger Administrative 
UI, which you can access at `http://:6080`.
+
+
+## User/Role Mapping
+
+When configuring your HAWQ cluster, you identify the HAWQ database objects to 
which you want specific users to have access. This configuration is required 
for both HAWQ-Native and HAWQ-Ranger authorization. 
+
+You create HAWQ users with the `createuser` command line utility or `CREATE 
ROLE` SQL command. These HAWQ users may or may not reflect an underlying 
operating system user.
+
+Ranger includes a `UserSync` process to synchronize users and groups on the 
\. You can sync users and groups from the operating system 
(default), a file, or from LDAP/AD services. Once the sync source is 
identified, Ranger `UserSync` automatically detects new users provisioned on 
the \.
+
+If your HAWQ cluster includes HAWQ-only roles (i.e. roles with no associated 
OS user), you must manually configure a Ranger user for each such role. You 
would use the Ranger Admin UI **Settings > Users/Groups** page for this purpose.
+
+
+
+## HAWQ Authorization
+
+
+###  pg_hba.conf
+The `pg_hba.conf` file on the HAWQ master node identifies the users you permit 
to access the HAWQ cluster, and the hosts from which the access may be 
initiated. This authentication is the first line of defense for both 
HAWQ-Native and HAWQ-Ranger authorization.
+
+
+###  HAWQ-Native Authorization
+HAWQ *always* employs its native authorization for operations on its catalog. 
HAWQ also uses only native authorization for the following HAWQ operations, 
*even when Ranger is enabled*. These operations are available to superusers and 
may be available those non-admin users to which access was specifically 
configured:
+
+- operations on HAWQ catalog
+- HAWQ catalog-related built-in functions
+- `CREATE DATABASE`, `DROP DATABASE`, `createdb`, `dropdb`
+- `hawq filespace`
+- `CREATE`, `DROP`, or `ALTER` commands for resource queues
+- `CREATE ROLE`, `DROP ROLE`, `SET ROLE`, `createuser`, `dropuser`
+- `CREATE TABLESPACE`, `DROP TABLESPACE` (Ranger does manage authorization for 
creating tables and 

incubator-hawq git commit: HAWQ-1418. Move print executing command after setup logging

2017-03-28 Thread lilima
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 46a9621bb -> 1e9ea9945


HAWQ-1418. Move print executing command after setup logging


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/1e9ea994
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/1e9ea994
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/1e9ea994

Branch: refs/heads/master
Commit: 1e9ea99458a251c3084e69147bdde2c19e702049
Parents: 46a9621
Author: Chunling Wang 
Authored: Tue Mar 28 18:15:00 2017 +0800
Committer: Chunling Wang 
Committed: Tue Mar 28 18:17:07 2017 +0800

--
 tools/bin/hawqregister | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1e9ea994/tools/bin/hawqregister
--
diff --git a/tools/bin/hawqregister b/tools/bin/hawqregister
index e5c3f6a..ff2bb96 100755
--- a/tools/bin/hawqregister
+++ b/tools/bin/hawqregister
@@ -34,17 +34,17 @@ except ImportError, e:
 sys.stderr.write('Cannot import module, please check that you have source 
greenplum_path.sh\n')
 sys.exit(2)
 
+# setup logging
+logger = get_default_logger()
+EXECNAME = os.path.split(__file__)[-1]
+setup_tool_logging(EXECNAME, getLocalHostname(), getUserName())
+
 # print executing command
 cmd = "Executing Command: ";
 for arg in sys.argv:
 cmd += arg + " "
 logger.info(cmd);
 
-# setup logging
-logger = get_default_logger()
-EXECNAME = os.path.split(__file__)[-1]
-setup_tool_logging(EXECNAME, getLocalHostname(), getUserName())
-
 def option_parser():
 '''option parser'''
 parser = OptParser(option_class=OptChecker,



incubator-hawq git commit: HAWQ-1140. Rename yml file name and table name in TestUsage2Case1ErrorHashTableRegistry (close #1200)

2017-03-28 Thread lilima
Repository: incubator-hawq
Updated Branches:
  refs/heads/master bbdcf95a0 -> 46a9621bb


HAWQ-1140. Rename yml file name and table name in 
TestUsage2Case1ErrorHashTableRegistry
(close #1200)


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/46a9621b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/46a9621b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/46a9621b

Branch: refs/heads/master
Commit: 46a9621bb4b02e6932feb5bb0c07193e2812e66b
Parents: bbdcf95
Author: Chunling Wang 
Authored: Tue Mar 28 17:31:55 2017 +0800
Committer: Lili Ma 
Committed: Tue Mar 28 17:42:05 2017 +0800

--
 .../test_hawq_register_usage2_case1.cpp | 90 ++--
 1 file changed, 45 insertions(+), 45 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/46a9621b/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp
--
diff --git 
a/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp 
b/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp
index 3623528..997a549 100644
--- a/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp
+++ b/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp
@@ -214,51 +214,51 @@ TEST_F(TestHawqRegister, 
TestUsage2Case1HDFSFilePathContainErrorSymbol) {
 
 TEST_F(TestHawqRegister, TestUsage2Case1ErrorHashTableRegistry) {
 SQLUtility util;
-util.execute("drop table if exists t_1_1;");
-util.execute("drop table if exists t_1_2;");
-util.execute("drop table if exists t_1_3;");
-util.execute("drop table if exists t_2;");
-util.execute("drop table if exists nt_1;");
-util.execute("drop table if exists nt_2;");
-
-util.execute("create table t_1_1(i int, j int, k int) with 
(appendonly=true, orientation=row, bucketnum=12) distributed by (i, j);");
-util.execute("insert into t_1_1 select generate_series(1, 100);");
-util.query("select * from t_1_1;", 100);
-util.execute("create table t_1_2(i int, j int, k int) with 
(appendonly=true, orientation=row) distributed by (i);");
-util.execute("insert into t_1_2 select generate_series(1, 100);");
-util.query("select * from t_1_2;", 100);
-util.execute("create table t_1_3(i int, j int, k int) with 
(appendonly=true, orientation=row) distributed randomly;");
-util.execute("insert into t_1_3 select generate_series(1, 100);");
-util.query("select * from t_1_3;", 100);
-util.execute("create table t_2(i int, j int, k int) with (appendonly=true, 
orientation=row) distributed by (i);");
-util.execute("insert into t_2 select generate_series(1, 100);");
-util.query("select * from t_2;", 100);
-util.execute("create table nt_1(i int, j int, k int) with 
(appendonly=true, orientation=row) distributed by (i, j);");
-util.execute("insert into nt_1 select generate_series(1, 100);");
-util.query("select * from nt_1;", 100);
-util.execute("create table nt_2(i int, j int, k int) with 
(appendonly=true, orientation=row) distributed by (j);");
-util.execute("insert into nt_2 select generate_series(1, 100);");
-util.query("select * from nt_2;", 100);
-
-EXPECT_EQ(0, Command::getCommandStatus(hawq::test::stringFormat("hawq 
extract -d %s -o t_1_1.yml 
testhawqregister_testusage2case1errorhashtableregistry.t_1_1", HAWQ_DB)));
-EXPECT_EQ(1, Command::getCommandStatus(hawq::test::stringFormat("hawq 
register -d %s -c t_1_1.yml 
testhawqregister_testusage2case1errorhashtableregistry.nt_1", HAWQ_DB)));
-EXPECT_EQ(0, Command::getCommandStatus(hawq::test::stringFormat("hawq 
extract -d %s -o t_1_2.yml 
testhawqregister_testusage2case1errorhashtableregistry.t_1_2", HAWQ_DB)));
-EXPECT_EQ(1, Command::getCommandStatus(hawq::test::stringFormat("hawq 
register -d %s -c t_1_2.yml 
testhawqregister_testusage2case1errorhashtableregistry.nt_1", HAWQ_DB)));
-EXPECT_EQ(0, Command::getCommandStatus(hawq::test::stringFormat("hawq 
extract -d %s -o t_1_3.yml 
testhawqregister_testusage2case1errorhashtableregistry.t_1_3", HAWQ_DB)));
-EXPECT_EQ(1, Command::getCommandStatus(hawq::test::stringFormat("hawq 
register -d %s -c t_1_3.yml 
testhawqregister_testusage2case1errorhashtableregistry.nt_1", HAWQ_DB)));
-EXPECT_EQ(0, Command::getCommandStatus(hawq::test::stringFormat("hawq 
extract -d %s -o t_2.yml 
testhawqregister_testusage2case1errorhashtableregistry.t_2", HAWQ_DB)));
-EXPECT_EQ(1, Command::getCommandStatus(hawq::test::stringFormat("hawq 
register -d %s -c t_2.yml 
testhawqregister_testusage2case1errorhashtableregistry.nt_2", HAWQ_DB)));
-
-EXPECT_EQ(0, Command::getCommandStatus("rm -rf 

[incubator-hawq] Git Push Summary

2017-03-28 Thread huor
Repository: incubator-hawq
Updated Branches:
  refs/heads/2.2.0.0-incubating [created] c2ba42026


incubator-hawq git commit: HAWQ-326. Support build rpm package for Apache HAWQ.

2017-03-28 Thread rlei
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 9d88cdd81 -> 22306b09a


HAWQ-326. Support build rpm package for Apache HAWQ.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/22306b09
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/22306b09
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/22306b09

Branch: refs/heads/master
Commit: 22306b09a165780ccd3f6a599ee2c05d4dfca041
Parents: 9d88cdd
Author: rlei 
Authored: Fri Mar 17 10:36:01 2017 +0800
Committer: rlei 
Committed: Tue Mar 28 14:30:35 2017 +0800

--
 GNUmakefile.in|  8 +++
 contrib/hawq-package/Makefile | 38 ++
 contrib/hawq-package/README   | 38 ++
 contrib/hawq-package/build_hawq_rpm.sh| 78 
 contrib/hawq-package/hawq.spec| 98 ++
 contrib/hawq-package/make_rpm_tarball.sh  | 80 +
 pxf/Makefile  |  2 +-
 ranger-plugin/Makefile|  9 +++
 ranger-plugin/scripts/build_ranger_rpm.sh | 50 +
 src/pl/pljava/Makefile| 20 +++---
 10 files changed, 410 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/22306b09/GNUmakefile.in
--
diff --git a/GNUmakefile.in b/GNUmakefile.in
index 081e6fe..8ac58e3 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -45,6 +45,12 @@ distprep:
$(MAKE) -C config $@
$(MAKE) -C contrib $@
 
+rpm:
+   $(MAKE) -C contrib/hawq-package $@
+   $(MAKE) -C pxf $@
+   $(MAKE) -C ranger-plugin $@
+   $(MAKE) -C contrib/hawq-package rpm-tarball
+
 feature-test:
$(MAKE) -C src feature-test
 
@@ -63,6 +69,8 @@ clean:
$(MAKE) -C config $@
$(MAKE) -C contrib $@
$(MAKE) -C tools $@
+   $(MAKE) -C contrib/hawq-package $@
+   $(MAKE) -C pxf $@
$(MAKE) -C ranger-plugin $@
-$(MAKE) -C src feature-test-clean
 # Garbage from autoconf:

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/22306b09/contrib/hawq-package/Makefile
--
diff --git a/contrib/hawq-package/Makefile b/contrib/hawq-package/Makefile
new file mode 100644
index 000..2175308
--- /dev/null
+++ b/contrib/hawq-package/Makefile
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-
+#
+# Makefile for the rpm package
+#
+#-
+
+subdir = contrib/hawq-package
+top_builddir = ../..
+
+all: rpm
+
+rpm:
+   @HAWQ_RELEASE_VERSION=$(HAWQ_RELEASE_VERSION) BUILD_MODE=$(BUILD_MODE) 
BUILD_NUMBER=$(BUILD_NUMBER) $(top_builddir)/$(subdir)/build_hawq_rpm.sh $@
+
+rpm-tarball:
+   @$(top_builddir)/$(subdir)/make_rpm_tarball.sh
+
+clean:
+   @rm -rf rpmbuild hawq_rpm_packages
+
+distclean: clean

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/22306b09/contrib/hawq-package/README
--
diff --git a/contrib/hawq-package/README b/contrib/hawq-package/README
new file mode 100644
index 000..8fb34fd
--- /dev/null
+++ b/contrib/hawq-package/README
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the