hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hubertzh...@apache.org
Subject [1/2] incubator-hawq git commit: HAWQ-1002. Implement configuration GUC related to Ranger.
Date Wed, 14 Dec 2016 08:37:16 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/ran5 e408bcd62 -> bbf897bcf


HAWQ-1002. Implement configuration GUC related to Ranger.


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

Branch: refs/heads/ran5
Commit: 5e429668fbe45f199e14fae861a408661b87f061
Parents: e408bcd
Author: hzhang2 <zhanghuan929@163.com>
Authored: Wed Dec 14 11:30:08 2016 +0800
Committer: hzhang2 <zhanghuan929@163.com>
Committed: Wed Dec 14 11:30:08 2016 +0800

----------------------------------------------------------------------
 src/backend/cdb/cdbvars.c      |  2 --
 src/backend/libpq/rangerrest.c | 19 +++++++++++++------
 src/backend/utils/misc/guc.c   |  2 ++
 src/include/cdb/cdbvars.h      |  2 --
 src/include/utils/guc.h        |  5 +++++
 5 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5e429668/src/backend/cdb/cdbvars.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/cdbvars.c b/src/backend/cdb/cdbvars.c
index d7a2e59..c2fca21 100644
--- a/src/backend/cdb/cdbvars.c
+++ b/src/backend/cdb/cdbvars.c
@@ -292,8 +292,6 @@ bool enable_prefer_list_to_rm;
  * reserved to facilitate showing settings in hawq-site.xml. */
 char  *master_addr_host;
 int    master_addr_port;
-char  *rps_addr_host;
-int    rps_addr_port;
 char  *standby_addr_host;
 int    seg_addr_port;
 char  *dfs_url;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5e429668/src/backend/libpq/rangerrest.c
----------------------------------------------------------------------
diff --git a/src/backend/libpq/rangerrest.c b/src/backend/libpq/rangerrest.c
index 81c2097..22d69ba 100644
--- a/src/backend/libpq/rangerrest.c
+++ b/src/backend/libpq/rangerrest.c
@@ -24,13 +24,13 @@
  *
  *-------------------------------------------------------------------------
  */
-#include <json-c/json.h>
-#include "utils/rangerrest.h"
-#include "utils/elog.h"
-#include "utils/palloc.h"
 #include "postgres.h"
+
+#include <json-c/json.h>
+
 #include "utils/acl.h"
-#include "nodes/pg_list.h"
+#include "utils/guc.h"
+#include "utils/rangerrest.h"
 
 /*
  * Internal buffer for libcurl context
@@ -433,7 +433,14 @@ void call_ranger_rest(CURL_HANDLE curl_handle, char* request)
 
     /* specify URL to get */
     //curl_easy_setopt(curl_handle->curl_handle, CURLOPT_URL, "http://localhost:8089/checkprivilege");
-    curl_easy_setopt(curl_handle->curl_handle, CURLOPT_URL, "http://10.32.127.114:8080/rps");
+    StringInfoData tname;
+    initStringInfo(&tname);
+    appendStringInfo(&tname, "http://");
+    appendStringInfo(&tname, rps_addr_host);
+    appendStringInfo(&tname, ":");
+    appendStringInfo(&tname, "%d", rps_addr_port);
+    appendStringInfo(&tname, "/rps");
+    curl_easy_setopt(curl_handle->curl_handle, CURLOPT_URL, tname.data);
 
     /* specify format */
     // struct curl_slist *plist = curl_slist_append(NULL, "Content-Type:application/json;charset=UTF-8");

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5e429668/src/backend/utils/misc/guc.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index f34a9b9..855e98c 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -779,6 +779,8 @@ bool gp_plpgsql_clear_cache_always = false;
 /* indicate whether called by gpdump, if yes, processutility will open some limitations */
 bool gp_called_by_pgdump = false;
 
+char   *rps_addr_host;
+int     rps_addr_port;
 
 /*
  * Displayable names for context types (enum GucContext)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5e429668/src/include/cdb/cdbvars.h
----------------------------------------------------------------------
diff --git a/src/include/cdb/cdbvars.h b/src/include/cdb/cdbvars.h
index 56b208f..9f6c3b1 100644
--- a/src/include/cdb/cdbvars.h
+++ b/src/include/cdb/cdbvars.h
@@ -1143,8 +1143,6 @@ extern bool debug_datalocality_time;
 /* New HAWQ 2.0 basic GUCs */
 extern char   *master_addr_host;
 extern int     master_addr_port;
-extern char   *rps_addr_host;
-extern int     rps_addr_port;
 extern char   *standby_addr_host;
 extern int     seg_addr_port;
 extern char   *dfs_url;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5e429668/src/include/utils/guc.h
----------------------------------------------------------------------
diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h
index 4041e41..95e14a4 100644
--- a/src/include/utils/guc.h
+++ b/src/include/utils/guc.h
@@ -450,6 +450,11 @@ extern bool optimizer_array_constraints;
  */
 extern bool	optimizer_partition_selection_log;
 
+/**
+ * rps host and port
+ */
+extern char   *rps_addr_host;
+extern int     rps_addr_port;
 /*
  * During insertion in a table with parquet partitions,
  * require tuples to be sorted by partition key.


Mime
View raw message