[ 
https://issues.apache.org/jira/browse/HDFS-13972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16803293#comment-16803293
 ] 

Brahma Reddy Battula commented on HDFS-13972:
---------------------------------------------

[~crh] thanks for working on this.

  
{quote} 

I think router should send back a redirect to datanode (instead of namenode) 
for CREATE calls with router's address and DT itself. This needs fundamental 
change in how "create" works in router web.
{quote}
Yes, we shouldn't expose namenode details to client. Even you can remove 
namenode attribute ("name.node),may followup jira.

 

 

*Couple of issues/queries on HDFS-13972-HDFS-13891.010.patch*

 
{code:java}
437 final Token<? extends TokenIdentifier> t = generateDelegationToken(
438 ugi, request.getUserPrincipal().getName());
{code}
 i) request.getUserPrincipal().getName()  needs to replace with 
ugi.getUserName(), as this can throw exception as servlet context can be 
different.

,ii) generateDelegationToken(..) should be implemented in router, Orelse this 
request will fail while creating Credentials as it's expect namenode but it 
will return the router.See, the following for same.
{code:java}
public Credentials createCredentials(final UserGroupInformation ugi,
 final String renewer) throws IOException {
 final NameNode namenode = (NameNode)context.getAttribute("name.node");
 final Credentials c = DelegationTokenSecretManager.createCredentials(
 namenode, ugi, renewer != null? renewer: ugi.getShortUserName());
 return c;
}{code}
 

So, finally it should like following.
{code:java}
// generate a token
final Token<? extends TokenIdentifier> t = generateDelegationToken(router, ugi, 
ugi.getUserName());{code}
 

*Please  check all the webhdfs commands.*

> RBF: Support for Delegation Token (WebHDFS)
> -------------------------------------------
>
>                 Key: HDFS-13972
>                 URL: https://issues.apache.org/jira/browse/HDFS-13972
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Íñigo Goiri
>            Assignee: CR Hota
>            Priority: Major
>         Attachments: HDFS-13972-HDFS-13891.001.patch, 
> HDFS-13972-HDFS-13891.002.patch, HDFS-13972-HDFS-13891.003.patch, 
> HDFS-13972-HDFS-13891.004.patch, HDFS-13972-HDFS-13891.005.patch, 
> HDFS-13972-HDFS-13891.006.patch, HDFS-13972-HDFS-13891.007.patch, 
> HDFS-13972-HDFS-13891.008.patch, HDFS-13972-HDFS-13891.009.patch, 
> HDFS-13972-HDFS-13891.010.patch, TestRouterWebHDFSContractTokens.java
>
>
> HDFS Router should support issuing HDFS delegation tokens through WebHDFS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to