Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
HAWQ-1350. Add --enable-rps option to build ranger-plugin when build …
Browse files Browse the repository at this point in the history
…hawq.
  • Loading branch information
stanlyxiang authored and Wen Lin committed Feb 24, 2017
1 parent 51590b9 commit 6bc9fd7
Show file tree
Hide file tree
Showing 9 changed files with 345 additions and 2 deletions.
5 changes: 5 additions & 0 deletions GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ all:
$(MAKE) -C config $@
$(MAKE) -C contrib $@
$(MAKE) -C tools $@
$(MAKE) -C ranger-plugin $@
@echo "All of HAWQ successfully made. Ready to install."

install:
Expand All @@ -28,13 +29,15 @@ install:
$(MAKE) -C config $@
$(MAKE) -C contrib $@
$(MAKE) -C tools $@
$(MAKE) -C ranger-plugin $@
@echo "HAWQ installation complete."

installdirs uninstall:
# $(MAKE) -C doc $@
$(MAKE) -C src $@
$(MAKE) -C config $@
$(MAKE) -C contrib $@
$(MAKE) -C ranger-plugin $@

distprep:
# $(MAKE) -C doc $@
Expand All @@ -60,6 +63,7 @@ clean:
$(MAKE) -C config $@
$(MAKE) -C contrib $@
$(MAKE) -C tools $@
$(MAKE) -C ranger-plugin $@
-$(MAKE) -C src feature-test-clean
# Garbage from autoconf:
@rm -rf autom4te.cache/
Expand All @@ -76,6 +80,7 @@ distclean maintainer-clean:
-$(MAKE) -C tools $@
-$(MAKE) -C src feature-test-clean
-$(MAKE) -C src $@
-$(MAKE) -C ranger-plugin $@
-rm -f config.cache config.log config.status GNUmakefile
# Garbage from autoconf:
@rm -rf autom4te.cache/
Expand Down
1 change: 1 addition & 0 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ m4_include([config/java.m4])
m4_include([config/tcl.m4])
m4_include([config/curl.m4])
m4_include([config/maven.m4])
m4_include([config/tomcat.m4])
57 changes: 57 additions & 0 deletions config/tomcat.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
dnl
dnl tomcat.m4: Locates the Apache Tomcat/6.0.x and its scripts and jars.
dnl

# PGAC_CATALINA_HOME
# ------------------
AC_DEFUN([PGAC_CATALINA_HOME],
[
AC_MSG_CHECKING([CATALINA_HOME])
dnl Use $CATALINA_HOME if specifed, otherwise look for java in the likely places.
dnl /usr/local/Cellar/tomcat@6/6.0.45/libexec
dnl /usr/lib/bigtop-tomcat
if test -x "${CATALINA_HOME}/bin/catalina.sh"; then
TOMCAT="${CATALINA_HOME}"
elif test -x "/usr/lib/bigtop-tomcat/bin/catalina.sh"; then
TOMCAT="/usr/lib/bigtop-tomcat/"
else
AC_MSG_RESULT(not found)
AC_MSG_ERROR([CATALINA_HOME not found])
fi
CATALINA_HOME="$TOMCAT"
AC_MSG_RESULT(${CATALINA_HOME})
AC_SUBST(CATALINA_HOME)
])

# PGAC_PATH_TOMCAT
# ----------------
AC_DEFUN([PGAC_PATH_TOMCAT],
[
CATALINA=none
SETCLASSPATH=none
AC_REQUIRE([PGAC_CATALINA_HOME])
AC_PATH_PROGS(CATALINA,catalina.sh,,${CATALINA_HOME}/bin)
AC_PATH_PROGS(SETCLASSPATH,setclasspath.sh,,${CATALINA_HOME}/bin)
])

# PGAC_CHECK_TOMCAT_EMBED_SETUP
# ----------------------------
AC_DEFUN([PGAC_CHECK_TOMCAT_EMBED_SETUP],
[
AC_REQUIRE([PGAC_PATH_TOMCAT])
# Check the current tomcat version
AC_MSG_CHECKING([for tomcat version])
version=`${CATALINA} version 2>&1 | grep "Server version" | cut -d '/' -f2`
AC_MSG_RESULT("$version")
if echo "$version" | sed ['s/[^0-9]/ /g'] | $AWK '{ if ([$]1 != 6) exit 0; else exit 1;}'
then
AC_MSG_ERROR([The installed version of tomcat is not compatiable to use with ranger-plugin.
Apache Tomcat/6.0.x is required, but this is $version])
fi
])
177 changes: 176 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,9 @@ CURL_CFLAGS
CURL_CONFIG
R_HOME
ZIC
SETCLASSPATH
CATALINA
CATALINA_HOME
JAVAC_FLAGS
JAVADOC
JAR
Expand Down Expand Up @@ -734,6 +737,7 @@ with_python
with_perl
with_tcl
enable_thread_safety
enable_rps
enable_orca
enable_email
enable_gphdfs
Expand Down Expand Up @@ -846,6 +850,7 @@ enable_snmp
enable_gphdfs
enable_email
enable_orca
enable_rps
enable_thread_safety
enable_thread_safety_force
with_tcl
Expand Down Expand Up @@ -1523,6 +1528,7 @@ disable 64-bit integer date/time support
--enable-gphdfs enables GPHDFS support
--enable-email enable email alerts
--enable-orca enable Pivotal Query Optimizer
--enable-rps enable hawq ranger plugin
--disable-thread-safety Do not make client libraries thread-safe
--enable-thread-safety-force force thread-safety despite thread test failure
--disable-xmltest Do not try to compile and run a test LIBXML program
Expand Down Expand Up @@ -5500,6 +5506,37 @@ fi



#
# Enable hawq ranger plugin
#

pgac_args="$pgac_args enable_rps"

# Check whether --enable-rps was given.
if test "${enable_rps+set}" = set; then :
enableval=$enable_rps;
case $enableval in
yes)

$as_echo "#define USE_RANGER 1" >>confdefs.h

;;
no)
:
;;
*)
as_fn_error $? "no argument expected for --enable-rps option" "$LINENO" 5
;;
esac

else
enable_rps=no

fi




#
# Enable thread-safe client libraries
#
Expand Down Expand Up @@ -8169,6 +8206,143 @@ $as_echo "yes" >&6; }

fi

if test "$enable_rps" = yes; then

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CATALINA_HOME" >&5
$as_echo_n "checking CATALINA_HOME... " >&6; }

if test -x "${CATALINA_HOME}/bin/catalina.sh"; then
TOMCAT="${CATALINA_HOME}"
elif test -x "/usr/local/Cellar/tomcat@6/6.0.45/libexec/bin/catalina.sh"; then
TOMCAT="/usr/local/Cellar/tomcat@6/6.0.45/libexec/"
elif test -x "/usr/lib/bigtop-tomcat/bin/catalina.sh"; then
TOMCAT="/usr/lib/bigtop-tomcat/"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
as_fn_error $? "CATALINA_HOME not found" "$LINENO" 5
fi
CATALINA_HOME="$TOMCAT"

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${CATALINA_HOME}" >&5
$as_echo "${CATALINA_HOME}" >&6; }



CATALINA=none
SETCLASSPATH=none


for ac_prog in catalina.sh
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_CATALINA+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CATALINA in
[\\/]* | ?:[\\/]*)
ac_cv_path_CATALINA="$CATALINA" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in ${CATALINA_HOME}/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_CATALINA="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS

;;
esac
fi
CATALINA=$ac_cv_path_CATALINA
if test -n "$CATALINA"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CATALINA" >&5
$as_echo "$CATALINA" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


test -n "$CATALINA" && break
done

for ac_prog in setclasspath.sh
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_SETCLASSPATH+:} false; then :
$as_echo_n "(cached) " >&6
else
case $SETCLASSPATH in
[\\/]* | ?:[\\/]*)
ac_cv_path_SETCLASSPATH="$SETCLASSPATH" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in ${CATALINA_HOME}/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_SETCLASSPATH="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS

;;
esac
fi
SETCLASSPATH=$ac_cv_path_SETCLASSPATH
if test -n "$SETCLASSPATH"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SETCLASSPATH" >&5
$as_echo "$SETCLASSPATH" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


test -n "$SETCLASSPATH" && break
done





# Check the current tomcat version
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tomcat version" >&5
$as_echo_n "checking for tomcat version... " >&6; }
version=`${CATALINA} version 2>&1 | grep "Server version" | cut -d '/' -f2`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$version\"" >&5
$as_echo "\"$version\"" >&6; }

if echo "$version" | sed 's/[^0-9]/ /g' | $AWK '{ if ($1 != 6) exit 0; else exit 1;}'
then
as_fn_error $? "The installed version of tomcat is not compatiable to use with ranger-plugin.
Apache Tomcat/6.0.x is required, but this is $version" "$LINENO" 5
fi


fi

ZIC=
if test "$cross_compiling" = yes && test -z "$with_system_tzdata"; then
# Extract the first word of "zic", so it can be a program name with args.
Expand Down Expand Up @@ -16544,7 +16718,7 @@ $as_echo "done" >&6; }
fi


ac_config_files="$ac_config_files GNUmakefile src/VERSIONS.mk depends/thirdparty/googletest/Makefile.global depends/libhdfs3/Makefile.global depends/libyarn/Makefile.global src/Makefile.global src/pl/pljava/src/java/Makefile.global"
ac_config_files="$ac_config_files GNUmakefile src/VERSIONS.mk depends/thirdparty/googletest/Makefile.global depends/libhdfs3/Makefile.global depends/libyarn/Makefile.global src/Makefile.global src/pl/pljava/src/java/Makefile.global ranger-plugin/Makefile.global"


ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/include/dynloader.h:src/backend/port/dynloader/${template}.h src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template}"
Expand Down Expand Up @@ -17277,6 +17451,7 @@ do
"depends/libyarn/Makefile.global") CONFIG_FILES="$CONFIG_FILES depends/libyarn/Makefile.global" ;;
"src/Makefile.global") CONFIG_FILES="$CONFIG_FILES src/Makefile.global" ;;
"src/pl/pljava/src/java/Makefile.global") CONFIG_FILES="$CONFIG_FILES src/pl/pljava/src/java/Makefile.global" ;;
"ranger-plugin/Makefile.global") CONFIG_FILES="$CONFIG_FILES ranger-plugin/Makefile.global" ;;
"src/backend/port/dynloader.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c" ;;
"src/backend/port/pg_sema.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}" ;;
"src/backend/port/pg_shmem.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}" ;;
Expand Down
15 changes: 14 additions & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,14 @@ PGAC_ARG_BOOL(enable, orca, no, [ --enable-orca enable Pivotal Query Opt
[Define to 1 to build with Pivotal Query Optimizer. (--enable-orca)])])
AC_SUBST(enable_orca)

#
# Enable hawq ranger plugin
#
PGAC_ARG_BOOL(enable, rps, no, [ --enable-rps enable hawq ranger plugin],
[AC_DEFINE([USE_RANGER], 1,
[Define to 1 to build with hawq ranger plugin. (--enable-rps)])])
AC_SUBST(enable_rps)

#
# Enable thread-safe client libraries
#
Expand Down Expand Up @@ -988,6 +996,11 @@ if test "$with_java" = yes; then
PGAC_CHECK_JAVA_EMBED_SETUP
fi

if test "$enable_rps" = yes; then
PGAC_PATH_TOMCAT
PGAC_CHECK_TOMCAT_EMBED_SETUP
fi

ZIC=
if test "$cross_compiling" = yes && test -z "$with_system_tzdata"; then
AC_PATH_PROG(ZIC, zic)
Expand Down Expand Up @@ -2140,7 +2153,7 @@ else
fi
AC_SUBST(vpath_build)

AC_CONFIG_FILES([GNUmakefile src/VERSIONS.mk depends/thirdparty/googletest/Makefile.global depends/libhdfs3/Makefile.global depends/libyarn/Makefile.global src/Makefile.global src/pl/pljava/src/java/Makefile.global])
AC_CONFIG_FILES([GNUmakefile src/VERSIONS.mk depends/thirdparty/googletest/Makefile.global depends/libhdfs3/Makefile.global depends/libyarn/Makefile.global src/Makefile.global src/pl/pljava/src/java/Makefile.global ranger-plugin/Makefile.global])

AC_CONFIG_LINKS([
src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c
Expand Down
2 changes: 2 additions & 0 deletions ranger-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/
Makefile.global
Loading

0 comments on commit 6bc9fd7

Please sign in to comment.