소스 검색

commit fa27e83f771a2aafba051dfb526d2ad0129059d3
Author: Devaraj Das <ddas@yahoo-inc.com>
Date: Mon Mar 1 00:47:24 2010 -0800

HDFS:1007 from https://issues.apache.org/jira/secure/attachment/12437464/distcp-hftp.2.1.patch

+++ b/YAHOO-CHANGES.txt
+ HDFS-1007. Fixes a bug on top of the earlier patch. (ddas)
+


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-patches@1077256 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 년 전
부모
커밋
a4516988b2
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java

+ 7 - 2
src/hdfs/org/apache/hadoop/hdfs/HftpFileSystem.java

@@ -99,7 +99,8 @@ public class HftpFileSystem extends FileSystem {
     };
 
   @Override
-  public void initialize(URI name, final Configuration conf) throws IOException {
+  public void initialize(final URI name, final Configuration conf) 
+  throws IOException {
     super.initialize(name, conf);
     setConf(conf);
     this.ugi = UserGroupInformation.getCurrentUser();
@@ -126,8 +127,12 @@ public class HftpFileSystem extends FileSystem {
       try {
         ugi.doAs(new PrivilegedExceptionAction<Object>() {
           public Object run() throws IOException {
+            StringBuffer sb = new StringBuffer();
             //try https (on http we NEVER get a delegation token)
-            String nnHttpUrl = "https://" + nnServiceName;
+            String nnHttpUrl = "https://" + 
+            (sb.append(NetUtils.normalizeHostName(name.getHost()))
+                .append(":").append(conf.getInt("dfs.https.port", 50470))).
+                toString();
             Credentials c;
             try {
               c = DelegationTokenFetcher.getDTfromRemote(nnHttpUrl,