hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject hadoop git commit: HADOOP-13928. TestAdlFileContextMainOperationsLive.testGetFileContext1 runtime error. (John Zhuge via lei)
Date Sun, 15 Jan 2017 06:36:42 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 914eeb997 -> 00dec84cc


HADOOP-13928. TestAdlFileContextMainOperationsLive.testGetFileContext1 runtime error. (John
Zhuge via lei)

(cherry picked from commit 15066a3e8ddacd36bf7be9fba0b10c350ae45668)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/00dec84c
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/00dec84c
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/00dec84c

Branch: refs/heads/branch-2
Commit: 00dec84cc2d4513922f3f758b54b8e2db9ebd6c8
Parents: 914eeb9
Author: Lei Xu <lei@apache.org>
Authored: Thu Jan 12 15:11:45 2017 +0800
Committer: Lei Xu <lei@apache.org>
Committed: Sun Jan 15 14:36:21 2017 +0800

----------------------------------------------------------------------
 .../apache/hadoop/fs/DelegateToFileSystem.java  |  2 +-
 .../hadoop/fs/TestDelegateToFsCheckPath.java    | 35 ++++++++++++++++----
 2 files changed, 30 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/00dec84c/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java
index dd69b08..d2550dc 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegateToFileSystem.java
@@ -160,7 +160,7 @@ public abstract class DelegateToFileSystem extends AbstractFileSystem
{
 
   @Override
   public int getUriDefaultPort() {
-    return DELEGATE_TO_FS_DEFAULT_PORT;
+    return getDefaultPortIfDefined(fsImpl);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hadoop/blob/00dec84c/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDelegateToFsCheckPath.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDelegateToFsCheckPath.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDelegateToFsCheckPath.java
index b1de316..6030c12 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDelegateToFsCheckPath.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDelegateToFsCheckPath.java
@@ -33,19 +33,29 @@ import org.junit.Test;
  */
 public class TestDelegateToFsCheckPath {
   @Test
-  public void testCheckPathWithoutDefaultPorts() throws URISyntaxException,
+  public void testCheckPathWithoutDefaultPort() throws URISyntaxException,
       IOException {
     URI uri = new URI("dummy://dummy-host");
-    AbstractFileSystem afs = new DummyDelegateToFileSystem(uri);
+    AbstractFileSystem afs = new DummyDelegateToFileSystem(uri,
+        new UnOverrideDefaultPortFileSystem());
     afs.checkPath(new Path("dummy://dummy-host"));
   }
 
+  @Test
+  public void testCheckPathWithDefaultPort() throws URISyntaxException,
+      IOException {
+    URI uri = new URI(String.format("dummy://dummy-host:%d",
+        OverrideDefaultPortFileSystem.DEFAULT_PORT));
+    AbstractFileSystem afs = new DummyDelegateToFileSystem(uri,
+        new OverrideDefaultPortFileSystem());
+    afs.checkPath(new Path("dummy://dummy-host/user/john/test"));
+  }
+
   private static class DummyDelegateToFileSystem
       extends DelegateToFileSystem {
-    public DummyDelegateToFileSystem(URI uri) throws URISyntaxException,
-        IOException {
-      super(uri, new UnOverrideDefaultPortFileSystem(), new Configuration(),
-          "dummy", false);
+    public DummyDelegateToFileSystem(URI uri, FileSystem fs)
+        throws URISyntaxException, IOException {
+      super(uri, fs, new Configuration(), "dummy", false);
     }
   }
 
@@ -123,4 +133,17 @@ public class TestDelegateToFsCheckPath {
       return null;
     }
   }
+
+  /**
+   * OverrideDefaultPortFileSystem defines default port.
+   */
+  private static class OverrideDefaultPortFileSystem
+      extends UnOverrideDefaultPortFileSystem {
+    private static final int DEFAULT_PORT = 1234;
+
+    @Override
+    public int getDefaultPort() {
+      return DEFAULT_PORT;
+    }
+  }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message