hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject incubator-hawq git commit: HAWQ-1452. Remove hawq_rps_address_suffix and hawq_rps_address_host in hawq-site.xml to simplify configuration for RPS High Availability
Date Thu, 04 May 2017 07:01:20 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 8f5aceb91 -> afcf34c09


HAWQ-1452. Remove hawq_rps_address_suffix and hawq_rps_address_host in hawq-site.xml to simplify
configuration for RPS High Availability


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

Branch: refs/heads/master
Commit: afcf34c09afe6dcd2ebd9e8acfbc82aeeb4e12a8
Parents: 8f5aceb
Author: stanlyxiang <stanly.sxiang@gmail.com>
Authored: Wed May 3 16:17:49 2017 +0800
Committer: Wen Lin <wlin@pivotal.io>
Committed: Thu May 4 15:00:40 2017 +0800

----------------------------------------------------------------------
 src/backend/libpq/rangerrest.c           | 10 ++++++----
 src/backend/utils/misc/etc/hawq-site.xml | 19 +++----------------
 src/backend/utils/misc/guc.c             | 20 --------------------
 src/include/utils/guc.h                  |  6 +-----
 tools/bin/hawqstate                      |  2 +-
 5 files changed, 11 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/afcf34c0/src/backend/libpq/rangerrest.c
----------------------------------------------------------------------
diff --git a/src/backend/libpq/rangerrest.c b/src/backend/libpq/rangerrest.c
index 92852bd..6457fd1 100644
--- a/src/backend/libpq/rangerrest.c
+++ b/src/backend/libpq/rangerrest.c
@@ -26,6 +26,8 @@
  */
 #include "utils/rangerrest.h"
 #include "utils/hsearch.h"
+#include "cdb/cdbvars.h"
+
 /*
  * A mapping from AclObjectKind to string
  */
@@ -399,11 +401,11 @@ static int call_ranger_rest(CURL_HANDLE curl_handle, const char* request)
 	StringInfoData tname;
 	initStringInfo(&tname);
 	appendStringInfo(&tname, "http://");
-	appendStringInfo(&tname, "%s", rps_addr_host);
+	appendStringInfo(&tname, "%s", master_addr_host);
 	appendStringInfo(&tname, ":");
 	appendStringInfo(&tname, "%d", rps_addr_port);
 	appendStringInfo(&tname, "/");
-	appendStringInfo(&tname, "%s", rps_addr_suffix);
+	appendStringInfo(&tname, "%s", "rps");
 	curl_easy_setopt(curl_handle->curl_handle, CURLOPT_URL, tname.data);
 	pfree(tname.data);	
 
@@ -425,8 +427,8 @@ static int call_ranger_rest(CURL_HANDLE curl_handle, const char* request)
 	/* check for errors */
 	if(res != CURLE_OK)
 	{
-		elog(ERROR, "ranger plugin service from http://%s:%d/%s is unavailable : %s.\n",
-				rps_addr_host, rps_addr_port, rps_addr_suffix, curl_easy_strerror(res));
+		elog(ERROR, "ranger plugin service from http://%s:%d/rps is unavailable : %s.\n",
+				master_addr_host, rps_addr_port, curl_easy_strerror(res));
 	}
 	else
 	{

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/afcf34c0/src/backend/utils/misc/etc/hawq-site.xml
----------------------------------------------------------------------
diff --git a/src/backend/utils/misc/etc/hawq-site.xml b/src/backend/utils/misc/etc/hawq-site.xml
index e436b5f..06307a4 100644
--- a/src/backend/utils/misc/etc/hawq-site.xml
+++ b/src/backend/utils/misc/etc/hawq-site.xml
@@ -161,24 +161,11 @@ under the License.
     </property>
 
     <property>
-        <name>hawq_rps_address_host</name>
-        <value>localhost</value>
-        <description>The hostname of Ranger Plugin Service.</description>
-    </property>
-
-    <property>
         <name>hawq_rps_address_port</name>
         <value>8432</value>
-        <description>The port number of Ranger Plugin Serice.</description>
-    </property>
-
-    <property>
-        <name>hawq_rps_address_suffix</name>
-        <value>rps</value>
-        <description>The suffix of Ranger Plugin Service. It co-works 
-                     with above two parameters, and HAWQ RPS address is 
-                     $hawq_rps_address_host:$hawq_rps_address_port/$hawq_rps_address_suffix
-                     For example, localhost:8432/rps.
+        <description>The port number of Ranger Plugin Serice. HAWQ RPS address is 
+                     http://$rps_host(hawq_master_address_host or hawq_standby_address_host):$hawq_rps_address_port/rps
+                     For example, http://localhost:8432/rps
         </description>
     </property>
     <!-- HAWQ ACL parameters ends here-->

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/afcf34c0/src/backend/utils/misc/guc.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 2c2b918..6a443ec 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -784,8 +784,6 @@ bool gp_called_by_pgdump = false;
 
 char   *acl_type;
 
-char   *rps_addr_host;
-char   *rps_addr_suffix;
 int     rps_addr_port;
 
 /*
@@ -8181,24 +8179,6 @@ static struct config_string ConfigureNamesString[] =
 	},
 
 	{
-		{"hawq_rps_address_host", PGC_POSTMASTER, PRESET_OPTIONS,
-			gettext_noop("ranger plugin server address hostname"),
-			NULL
-		},
-		&rps_addr_host,
-		"localhost", NULL, NULL
-	},
-
-	{
-		{"hawq_rps_address_suffix", PGC_POSTMASTER, PRESET_OPTIONS,
-			gettext_noop("ranger plugin server suffix of restful service address"),
-			NULL
-		},
-		&rps_addr_suffix,
-		"rps", NULL, NULL
-	},
-
-	{
 		{"hawq_acl_type", PGC_POSTMASTER, PRESET_OPTIONS,
 			gettext_noop("hawq acl mode, currently 'standalone' and 'ranger' is available"),
 			NULL

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/afcf34c0/src/include/utils/guc.h
----------------------------------------------------------------------
diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h
index 86154ee..a5b8214 100644
--- a/src/include/utils/guc.h
+++ b/src/include/utils/guc.h
@@ -457,11 +457,7 @@ extern bool	optimizer_partition_selection_log;
 /* acl type for privileges check */
 extern char   *acl_type;
 
-/**
- * rps host and port
- */
-extern char   *rps_addr_host;
-extern char   *rps_addr_suffix;
+/* rps port*/
 extern int     rps_addr_port;
 /*
  * During insertion in a table with parquet partitions,

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/afcf34c0/tools/bin/hawqstate
----------------------------------------------------------------------
diff --git a/tools/bin/hawqstate b/tools/bin/hawqstate
index 5f623d9..ff9af41 100755
--- a/tools/bin/hawqstate
+++ b/tools/bin/hawqstate
@@ -74,7 +74,7 @@ def get_guc_value(guc):
 def check_rps_status(master_or_standby):
     hawq_rps_address_host = get_guc_value(master_or_standby)
     hawq_rps_address_port = get_guc_value("hawq_rps_address_port")
-    hawq_rps_address_suffix = get_guc_value("hawq_rps_address_suffix")
+    hawq_rps_address_suffix = "rps"
     params = ["curl --connect-timeout 2 http://", hawq_rps_address_host.strip(), ":", hawq_rps_address_port.strip(),
"/", hawq_rps_address_suffix.strip(), "/version"]
     check_cmd = ''.join(params)
     status, output = commands.getstatusoutput(check_cmd)


Mime
View raw message