You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by denalex <gi...@git.apache.org> on 2017/10/23 18:27:24 UTC
[GitHub] incubator-hawq pull request #1303: HAWQ-1540. PXF should not accept paramete...
GitHub user denalex opened a pull request:
https://github.com/apache/incubator-hawq/pull/1303
HAWQ-1540. PXF should not accept parameters for init command
Currently PXF accepts --hadoop-home parameter for init command, which is used in greenplum-embedded deployment to specify where Hadoop client artifacts are installed. The desired behavior is:
* do not accept any parameters during init command
* rely on configuration provided by conf/pxf-env.sh file
* introduce new HADOOP_DISTRO variable that can take the following values: [<empty>, HDP, CDH, CUSTOM]
* when the value is empty – the script will check for existence of RPM-installed HDP hadoop-client in /usr/hdp/current/hadoop-client/client and if found, will use HDP-specific private classpath template to generate new pxf-private.classpath file. If not found, the script will check for existence of RPM-installed CDH hadoop-client in /usr/lib/hadoop/client and if found, will use CDH-specific private classpath template to generate new pxf-private.classpath file. If none were found, the script will check for a TAR-installed hadoop client in the directory specified by the new variable HADOOP_ROOT under $ {HADOOP_ROOT}/hadoop/share/hadoop/common/lib. If found, the script will use TAR-specific private classpath template to generate new pxf-private.classpath file. That template assumes Hadoop client (and optionally Hive and HBase clients) are installed under a common directorythat is pointed to by HADOOP_ROOT variable. A user will have to specify this variable or edit the pxf-env.sh c
onfig file before attempting pxf init command. If HADOOP_ROOT is not set of ${HADOOP_ROOT}
/hadoop/share/hadoop/common/lib directory does not exist, the script will error out.
* when the value is HDP – the script will check for existence of RPM-installed HDP hadoop-client in /usr/hdp/current/hadoop-client/client and if found, will use HDP-specific private classpath template to generate new pxf-private.classpath file. If not found, the script will check for TAR-installed distribution as described above.
* when the value is CDH – the script will check for existence of RPM-installed CDH hadoop-client in /usr/lib/hadoop/client and if found, will use CDH-specific private classpath template to generate new pxf-private.classpath file. If not found, the script will check for TAR-installed distribution as described above.
* when the value is CUSTOM – the script will check for TAR-installed distribution as described above, except it will not error out if HADOOP_ROOT is not set or points to a non-existing directory. If HADOOP_ROOT is set, the value will be substituted in tar-based template, even if the directory does not yet exist. If HADOOP_ROOT is not set, the tar-based template is copied to the conf/pxf-private.classpath file and the user will have to perform the editing of this file.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/denalex/incubator-hawq pxf-rpm
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-hawq/pull/1303.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1303
----
commit 3bf9690ef1bb0d854cdaf02b51c7d676d90bd18e
Author: Alexander Denissov <ad...@pivotal.io>
Date: 2017-10-18T20:57:03Z
removed options from pxf init command
commit 7014c312e53ca0de70634f50f9ef583306fdf4b3
Author: Alexander Denissov <ad...@pivotal.io>
Date: 2017-10-18T23:31:20Z
added hadoopDistro to install task
commit 6bff61ee7232119becbec6e82423a3b8598aec6c
Author: Alexander Denissov <ad...@pivotal.io>
Date: 2017-10-18T23:46:46Z
added comments to the template
commit c17ef7a30bf830ee5d1c01f0168ba6c3c7a038e7
Author: Alexander Denissov <ad...@pivotal.io>
Date: 2017-10-19T00:03:29Z
fixed exit statement
commit 056f92745965aa59bf68387137bc0a7f823e7935
Author: Alexander Denissov <ad...@pivotal.io>
Date: 2017-10-20T17:39:17Z
refactored for HADOOP_ROOT
commit 1127c3f53331af24eb27f889f926c9d84a621ed0
Author: Alexander Denissov <ad...@pivotal.io>
Date: 2017-10-20T18:03:33Z
fixed build.gradle
commit cd50420e6c53654b11eae96a3cdbae17ecba673e
Author: Alexander Denissov <ad...@pivotal.io>
Date: 2017-10-20T18:45:59Z
added additional jar for hbase
commit f9478e2eb1f72da038d43a468b11757a4f2592be
Author: Alexander Denissov <ad...@pivotal.io>
Date: 2017-10-21T00:33:19Z
added htrace-core.jar from hbase
commit 6dffc018cd073d759ebdb04eefba8d60ed65ee0b
Author: Alexander Denissov <ad...@pivotal.io>
Date: 2017-10-23T17:23:55Z
changed log level to info
commit 0d98fcba4897b2af9ae94e3e5bd3ae07763ee261
Author: Alexander Denissov <ad...@pivotal.io>
Date: 2017-10-23T17:44:35Z
updated message
commit 918eba6b0a99454b993f13bb3000c66ab0de015f
Author: Alexander Denissov <ad...@pivotal.io>
Date: 2017-10-23T17:53:10Z
updated message
----
---
[GitHub] incubator-hawq pull request #1303: HAWQ-1540. PXF should not accept paramete...
Posted by shivzone <gi...@git.apache.org>.
Github user shivzone commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1303#discussion_r146368713
--- Diff: pxf/pxf-service/src/configs/templates/pxf-private-hdp.classpath.template ---
@@ -0,0 +1,81 @@
+# 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.
+
+##################################################################
+# This file contains the internal classpaths required to run PXF.
--- End diff --
Add a note here that this is meant for HDP rpm distribution
---
[GitHub] incubator-hawq pull request #1303: HAWQ-1540. PXF should not accept paramete...
Posted by denalex <gi...@git.apache.org>.
Github user denalex commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1303#discussion_r146398591
--- Diff: pxf/pxf-service/src/configs/templates/pxf-private-cdh.classpath.template ---
@@ -0,0 +1,81 @@
+# 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.
+
+##################################################################
+# This file contains the internal classpaths required to run PXF.
--- End diff --
fixed
---
[GitHub] incubator-hawq pull request #1303: HAWQ-1540. PXF should not accept paramete...
Posted by shivzone <gi...@git.apache.org>.
Github user shivzone commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1303#discussion_r146369032
--- Diff: pxf/pxf-service/src/configs/templates/pxf-private-tar.classpath.template ---
@@ -0,0 +1,81 @@
+# 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.
+
+##################################################################
+# This file contains the internal classpaths required to run PXF.
--- End diff --
Add a note that this is compatible with hadoop tarbal layout
---
[GitHub] incubator-hawq pull request #1303: HAWQ-1540. PXF should not accept paramete...
Posted by denalex <gi...@git.apache.org>.
Github user denalex commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1303#discussion_r146398533
--- Diff: pxf/pxf-service/src/configs/templates/pxf-private-tar.classpath.template ---
@@ -0,0 +1,81 @@
+# 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.
+
+##################################################################
+# This file contains the internal classpaths required to run PXF.
--- End diff --
fixed
---
[GitHub] incubator-hawq pull request #1303: HAWQ-1540. PXF should not accept paramete...
Posted by sansanichfb <gi...@git.apache.org>.
Github user sansanichfb commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1303#discussion_r146361770
--- Diff: pxf/pxf-service/src/scripts/pxf-service ---
@@ -292,38 +288,90 @@ function createRunDir()
return 0
}
+function check_hadoop_install()
+{
+ local distro_type=${1}
+ case "${distro_type}" in
+ hdp|HDP)
+ if [ -d "/usr/hdp/current/hadoop-client/client" ]; then
+ DISTRO="hdp"
+ return 0;
+ fi
+ ;;
+ cdh|CDH)
+ if [ -d "/usr/lib/hadoop/client" ]; then
+ DISTRO="cdh"
+ return 0;
+ fi
+ ;;
+ tar|TAR)
+ if [ -n "${HADOOP_ROOT}" ] && [ -d "${HADOOP_ROOT}/hadoop/share/hadoop/common/lib" ]; then
+ DISTRO="tar"
+ return 0;
+ fi
+ ;;
+ custom|CUSTOM)
+ # use tarball template for custom distro, do not require HADOOP_ROOT to be set
+ DISTRO="tar"
+ return 0;
+ ;;
+ *)
+ fail "Unknown hadoop distribution type: HADOOP_DISTRO=${distro_type}"
+ ;;
+ esac
+ # the distro type was not found installed, return failure code
--- End diff --
Maybe print error message, letting user know that no Hadoop is installed.
---
[GitHub] incubator-hawq pull request #1303: HAWQ-1540. PXF should not accept paramete...
Posted by denalex <gi...@git.apache.org>.
Github user denalex commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1303#discussion_r146359943
--- Diff: pxf/pxf-service/src/scripts/pxf-service ---
@@ -206,24 +213,13 @@ function doInit()
echo WARNING: instance already exists in $instance_root, nothing to do...
return 0
fi
- # Generate private classpath file only if user specified hadoop_home option
- # Otherwise use default file
- if [ ! -z $hadoop_home ]; then
- generatePrivateClasspath || return 1
- else
- if [ ! -z $hbase_home ]; then
- echo WARNING: hbase_home option will be ignored, please specify hadoop_home
- fi
- if [ ! -z $hive_home ]; then
- echo WARNING: hive_home option will be ignored, please specify hadoop_home
- fi
- fi
+ determineHadoopDistro
--- End diff --
fixed
---
[GitHub] incubator-hawq pull request #1303: HAWQ-1540. PXF should not accept paramete...
Posted by denalex <gi...@git.apache.org>.
Github user denalex closed the pull request at:
https://github.com/apache/incubator-hawq/pull/1303
---
[GitHub] incubator-hawq pull request #1303: HAWQ-1540. PXF should not accept paramete...
Posted by denalex <gi...@git.apache.org>.
Github user denalex commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1303#discussion_r146398562
--- Diff: pxf/pxf-service/src/configs/templates/pxf-private-hdp.classpath.template ---
@@ -0,0 +1,81 @@
+# 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.
+
+##################################################################
+# This file contains the internal classpaths required to run PXF.
--- End diff --
fixed
---
[GitHub] incubator-hawq issue #1303: HAWQ-1540. PXF should not accept parameters for ...
Posted by shivzone <gi...@git.apache.org>.
Github user shivzone commented on the issue:
https://github.com/apache/incubator-hawq/pull/1303
LGTM. Please make sure you certify the pxf service script on mac as well
---
[GitHub] incubator-hawq pull request #1303: HAWQ-1540. PXF should not accept paramete...
Posted by shivzone <gi...@git.apache.org>.
Github user shivzone commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1303#discussion_r146368643
--- Diff: pxf/pxf-service/src/configs/templates/pxf-private-cdh.classpath.template ---
@@ -0,0 +1,81 @@
+# 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.
+
+##################################################################
+# This file contains the internal classpaths required to run PXF.
--- End diff --
Add a note here that this is meant for CDH rpm distribution
---
[GitHub] incubator-hawq pull request #1303: HAWQ-1540. PXF should not accept paramete...
Posted by denalex <gi...@git.apache.org>.
Github user denalex commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1303#discussion_r146362612
--- Diff: pxf/pxf-service/src/scripts/pxf-service ---
@@ -292,38 +288,90 @@ function createRunDir()
return 0
}
+function check_hadoop_install()
+{
+ local distro_type=${1}
+ case "${distro_type}" in
+ hdp|HDP)
+ if [ -d "/usr/hdp/current/hadoop-client/client" ]; then
+ DISTRO="hdp"
+ return 0;
+ fi
+ ;;
+ cdh|CDH)
+ if [ -d "/usr/lib/hadoop/client" ]; then
+ DISTRO="cdh"
+ return 0;
+ fi
+ ;;
+ tar|TAR)
+ if [ -n "${HADOOP_ROOT}" ] && [ -d "${HADOOP_ROOT}/hadoop/share/hadoop/common/lib" ]; then
+ DISTRO="tar"
+ return 0;
+ fi
+ ;;
+ custom|CUSTOM)
+ # use tarball template for custom distro, do not require HADOOP_ROOT to be set
+ DISTRO="tar"
+ return 0;
+ ;;
+ *)
+ fail "Unknown hadoop distribution type: HADOOP_DISTRO=${distro_type}"
+ ;;
+ esac
+ # the distro type was not found installed, return failure code
--- End diff --
good point, I wanted to do that too, but this function is called repeatedly from the logic below and in some cases it might go via HDP / CDH/ TAR calls consecutively, so erring out is not an option here and I believe informing user about failures of intermediate steps would be confusing.
---
[GitHub] incubator-hawq pull request #1303: HAWQ-1540. PXF should not accept paramete...
Posted by lavjain <gi...@git.apache.org>.
Github user lavjain commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1303#discussion_r146359219
--- Diff: pxf/pxf-service/src/scripts/pxf-service ---
@@ -206,24 +213,13 @@ function doInit()
echo WARNING: instance already exists in $instance_root, nothing to do...
return 0
fi
- # Generate private classpath file only if user specified hadoop_home option
- # Otherwise use default file
- if [ ! -z $hadoop_home ]; then
- generatePrivateClasspath || return 1
- else
- if [ ! -z $hbase_home ]; then
- echo WARNING: hbase_home option will be ignored, please specify hadoop_home
- fi
- if [ ! -z $hive_home ]; then
- echo WARNING: hive_home option will be ignored, please specify hadoop_home
- fi
- fi
+ determineHadoopDistro
--- End diff --
Indentation (minor)
---
[GitHub] incubator-hawq issue #1303: HAWQ-1540. PXF should not accept parameters for ...
Posted by denalex <gi...@git.apache.org>.
Github user denalex commented on the issue:
https://github.com/apache/incubator-hawq/pull/1303
Committed:
commit d2d3eaf508ef0aabcca28b73faa910f343b392fc
Author: Alexander Denissov <ad...@pivotal.io>
Date: Wed Oct 18 13:57:03 2017 -0700
HAWQ-1540. PXF should not accept parameters for init command
---