hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shiv...@apache.org
Subject incubator-hawq git commit: HAWQ-462. Configure dfs_address only if secure
Date Tue, 08 Mar 2016 22:02:28 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-462 07d31d33f -> 287a7f0aa


HAWQ-462. Configure dfs_address only if secure


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

Branch: refs/heads/HAWQ-462
Commit: 287a7f0aa25fa806c259b7c7a68cc8c89c78045d
Parents: 07d31d3
Author: Shivram Mani <shivram.mani@gmail.com>
Authored: Tue Mar 8 14:02:22 2016 -0800
Committer: Shivram Mani <shivram.mani@gmail.com>
Committed: Tue Mar 8 14:02:22 2016 -0800

----------------------------------------------------------------------
 src/backend/access/external/hd_work_mgr.c  | 15 +++++++++------
 src/backend/access/external/pxfuriparser.c | 18 +++++++++++-------
 src/include/access/pxfuriparser.h          |  2 +-
 3 files changed, 21 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/287a7f0a/src/backend/access/external/hd_work_mgr.c
----------------------------------------------------------------------
diff --git a/src/backend/access/external/hd_work_mgr.c b/src/backend/access/external/hd_work_mgr.c
index f07ea7c..8fee2e5 100644
--- a/src/backend/access/external/hd_work_mgr.c
+++ b/src/backend/access/external/hd_work_mgr.c
@@ -769,11 +769,15 @@ make_allocation_output_string(List *segment_fragments)
 	initStringInfo(&segwork);
 	appendStringInfoString(&segwork, SEGWORK_PREFIX);
 	
-	/* Add dfs_address from pg_filespace to the segment data. Fixes HAWQ-462 *//* dfs_address
from pg_filespace entry */
-	char* dfs_address = NULL;
-	get_hdfs_location_from_filespace(&dfs_address);
-	appendStringInfoString(&segwork, dfs_address);
-	appendStringInfoChar(&segwork, SEGWORK_DFS_DELIM);
+	if (enable_secure_filesystem)
+	{
+		/* Add dfs_address from pg_filespace to the segment data. Fixes HAWQ-462 *//* dfs_address
from pg_filespace entry */
+		char* dfs_address = NULL;
+		get_hdfs_location_from_filespace(&dfs_address);
+		appendStringInfoString(&segwork, dfs_address);
+		appendStringInfoChar(&segwork, SEGWORK_DFS_DELIM);
+		pfree(dfs_address);
+	}
 
 	foreach(frag_cell, segment_fragments)
 	{
@@ -802,7 +806,6 @@ make_allocation_output_string(List *segment_fragments)
 		appendStringInfoString(&segwork, fragment_str.data);
 		pfree(fragment_str.data);
 	}
-	pfree(dfs_address);
 
 	return segwork.data;
 }

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/287a7f0a/src/backend/access/external/pxfuriparser.c
----------------------------------------------------------------------
diff --git a/src/backend/access/external/pxfuriparser.c b/src/backend/access/external/pxfuriparser.c
index 24399e2..a0222c7 100644
--- a/src/backend/access/external/pxfuriparser.c
+++ b/src/backend/access/external/pxfuriparser.c
@@ -623,7 +623,8 @@ GPHDUri_debug_print_segwork(GPHDUri *uri)
 
 /*
  * GPHDUri_parse_segwork parses the segwork section of the uri.
- * ...&segwork=dfs_address@<size>@<ip>@<port>@<index><size>@<ip>@<port>@<index><size>...
+ * ...&segwork=<dfs_address>@<size>@<ip>@<port>@<index><size>@<ip>@<port>@<index><size>...
+ * <dfs_address>@ is present only if secure
  */
 static void
 GPHDUri_parse_segwork(GPHDUri *uri, const char *uri_str)
@@ -639,13 +640,16 @@ GPHDUri_parse_segwork(GPHDUri *uri, const char *uri_str)
 		return;
 	segwork += strlen(segwork_substring);
 
-	/* parse dfs address */
-	size_end = strchr(segwork, segwork_dfs_separator);
-	if(size_end != NULL)
+	if (enable_secure_filesystem)
 	{
-		*size_end = '\0';
-		uri->dfs_address = pnstrdup(segwork, size_end-segwork);
-		segwork = size_end + 1;
+		/* parse dfs address */
+		size_end = strchr(segwork, segwork_dfs_separator);
+		if(size_end != NULL)
+		{
+			*size_end = '\0';
+			uri->dfs_address = pnstrdup(segwork, size_end-segwork);
+			segwork = size_end + 1;
+		}
 	}
 
 	/*

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/287a7f0a/src/include/access/pxfuriparser.h
----------------------------------------------------------------------
diff --git a/src/include/access/pxfuriparser.h b/src/include/access/pxfuriparser.h
index b349029..dad81a6 100644
--- a/src/include/access/pxfuriparser.h
+++ b/src/include/access/pxfuriparser.h
@@ -77,7 +77,7 @@ typedef struct GPHDUri
 	 */
 	NNHAConf        *ha_nodes;
 
-	/* dfs address from pg_filespace (optional) */
+	/* dfs address from pg_filespace (optional, required only if secure) */
 	char			*dfs_address;
 } GPHDUri;
 


Mime
View raw message