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

Jing Zhao commented on HDFS-5506:
---------------------------------

The patch looks good in general. Some comments:
# DelegationTokenFetcher#getDTfromRemote
{code}
      StringBuffer buf = new StringBuffer(nnUri.toString())
        .append(GetDelegationTokenServlet.PATH_SPEC);
{code}
Let's just use StringBuilder here.
# This code will be used by HDFS-5502 I guess? Let's merge it there.
{code}
        token.setKind(https ? HsftpFileSystem.TOKEN_KIND
            : HftpFileSystem.TOKEN_KIND);
{code}
# The following code needs to updated since the run(...) method is used not 
only for
cancelling token. Also "failed" is not updated in the catch section.
{code}
    boolean failed = false;
    try {
      conn = (HttpURLConnection) factory.openConnection(url, true);
      if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
        throw new IOException("Error cancelling token: "
            + conn.getResponseMessage());
      }
    } catch (IOException ie) {
      LOG.info("error in cancel over HTTP", ie);
{code}


> Use URLConnectionFactory in DelegationTokenFetcher
> --------------------------------------------------
>
>                 Key: HDFS-5506
>                 URL: https://issues.apache.org/jira/browse/HDFS-5506
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Haohui Mai
>            Assignee: Haohui Mai
>         Attachments: HDFS-5506.000.patch, HDFS-5506.001.patch
>
>
> HftpFileSystem uses DelegationTokenFetcher to get delegation token from the 
> server. DelegationTokenFetcher should use the same URLConnectionFactory to 
> open all HTTP / HTTPS connections so that things like SSL certificates, 
> timeouts are respected.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to