[ 
https://issues.apache.org/jira/browse/HADOOP-5363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689222#action_12689222
 ] 

Chris Douglas commented on HADOOP-5363:
---------------------------------------

For the forwarding servlets, I was thinking that a single servlet could handle 
the requests for anything but "/file", which gets handled by a different 
servlet registered for those requests. The servlet handling "/file" can be a 
subclass of the normal forwarding servlet, overriding a function that contains 
the "else" clause in the base class, and the behavior for "/file" in the 
subclass servlet. So in ProxyForwardServlet, there's a call out of 
{{forwardRequest}} to some function {{buildForwardPath}} (or whatever), that in 
ProxyForwardServlet contains the equivalent to the "else":
{noformat}
+      if (request.getPathInfo() != null) {
+        path += request.getPathInfo();
+      }
+      if (request.getQueryString() != null) {
+        path += "?" + request.getQueryString();
+      }
{noformat}

but in the subclass registered for "/file" requests, {{buildForwardPath}} 
contains the equivalent to:
{noformat}
+      // use streamFile for file access
+      path = "/streamFile";
+      path += "?filename=" + request.getPathInfo();
+      UnixUserGroupInformation ugi = 
(UnixUserGroupInformation)request.getAttribute("authorized.ugi");
+      if (ugi != null) {
+        path += "&ugi=" + ugi.toString();
+      }
{noformat}

So then the behavior is bound to the servlets registered to these paths, rather 
than making the behavior of this servlet vary depending on the paths to which 
it is bound.

> Proxying for multiple HDFS clusters of different versions
> ---------------------------------------------------------
>
>                 Key: HADOOP-5363
>                 URL: https://issues.apache.org/jira/browse/HADOOP-5363
>             Project: Hadoop Core
>          Issue Type: New Feature
>          Components: contrib/hdfsproxy
>            Reporter: Kan Zhang
>            Assignee: zhiyong zhang
>         Attachments: HADOOP-5363.patch, HADOOP-5363.patch, HADOOP-5363.patch
>
>
> A single hdfsproxy server should be able to proxy for multiple HDFS clusters, 
> whose Hadoop versions may be different from each other.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to