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-459. ProtocolData handling for MetdataResource
Date Thu, 24 Mar 2016 19:02:52 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-459 bb7773478 -> 20c45fe50


HAWQ-459. ProtocolData handling for MetdataResource


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

Branch: refs/heads/HAWQ-459
Commit: 20c45fe5037dc5fde592403bee73b187e3f10a47
Parents: bb77734
Author: Shivram Mani <shivram.mani@gmail.com>
Authored: Thu Mar 24 12:02:48 2016 -0700
Committer: Shivram Mani <shivram.mani@gmail.com>
Committed: Thu Mar 24 12:02:48 2016 -0700

----------------------------------------------------------------------
 .../hawq/pxf/service/rest/MetadataResource.java   |  5 +++--
 .../hawq/pxf/service/utilities/ProtocolData.java  | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/20c45fe5/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/rest/MetadataResource.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/rest/MetadataResource.java
b/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/rest/MetadataResource.java
index cb50479..e16d14a 100644
--- a/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/rest/MetadataResource.java
+++ b/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/rest/MetadataResource.java
@@ -94,8 +94,9 @@ public class MetadataResource extends RestResource {
             Map<String, String> params = convertToCaseInsensitiveMap(headers.getRequestHeaders());
 
             // Add profile and verify token
-            params.put("X-GP-PROFILE", profile.toLowerCase());
-            ProtocolData protData = new ProtocolData(params);
+            ProtocolData protData = new ProtocolData(params, profile.toLowerCase());
+
+            // 0. Verify token
             SecuredHDFS.verifyToken(protData, servletContext);
 
             // 1. start MetadataFetcher

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/20c45fe5/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/utilities/ProtocolData.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/utilities/ProtocolData.java
b/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/utilities/ProtocolData.java
index 50ce46a..ec258fa 100644
--- a/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/utilities/ProtocolData.java
+++ b/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/utilities/ProtocolData.java
@@ -151,6 +151,24 @@ public class ProtocolData extends InputData {
     }
 
     /**
+     * Constructs a ProtocolData. Parses X-GP-* configuration variables.
+     *
+     * @param paramsMap contains all query-specific parameters from Hawq
+     * @param profile contains the profile name
+     */
+    public ProtocolData(Map<String, String> paramsMap, String profileString) {
+        requestParametersMap = paramsMap;
+        profile = profileString;
+        setProfilePlugins();
+        metadata = getProperty("METADATA");
+
+        /* Kerberos token information */
+        if (UserGroupInformation.isSecurityEnabled()) {
+            token = getProperty("TOKEN");
+        }
+    }
+
+    /**
      * Sets the requested profile plugins from profile file into
      * {@link #requestParametersMap}.
      */


Mime
View raw message