hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aajis...@apache.org
Subject hadoop git commit: HDFS-9431. DistributedFileSystem#concat fails if the target path is relative. Contributed by Kazuho Fujii.
Date Thu, 19 Nov 2015 11:58:51 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.6 937d9653a -> 68b1abe5c


HDFS-9431. DistributedFileSystem#concat fails if the target path is relative. Contributed
by Kazuho Fujii.

(cherry picked from commit ac1aa6c8197268ea83f44747199d560be9e299ae)
(cherry picked from commit c74e42b4a2293c8adb99b22929047a8d07242d06)


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

Branch: refs/heads/branch-2.6
Commit: 68b1abe5ccbac4cd56bd21146d32e06e84902c3e
Parents: 937d965
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Thu Nov 19 20:55:01 2015 +0900
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Thu Nov 19 20:56:08 2015 +0900

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt            |  3 +++
 .../org/apache/hadoop/hdfs/DistributedFileSystem.java  |  2 +-
 .../hadoop/hdfs/server/namenode/TestHDFSConcat.java    | 13 +++++++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/68b1abe5/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index edacccc..e08f665 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -15,6 +15,9 @@ Release 2.6.3 - UNRELEASED
     HDFS-8615. Correct HTTP method in WebHDFS document.
     (Brahma Reddy Battula via aajisaka)
 
+    HDFS-9431. DistributedFileSystem#concat fails if the target path is
+    relative. (Kazuho Fujii via aajisaka)
+
 Release 2.6.2 - 2015-10-28
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/68b1abe5/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
index e796a5c..7a88832 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
@@ -535,7 +535,7 @@ public class DistributedFileSystem extends FileSystem {
       for (int i=0; i<psrcs.length; i++) {
         srcsStr[i] = getPathName(srcs[i]);
       }
-      dfs.concat(getPathName(trg), srcsStr);
+      dfs.concat(getPathName(absF), srcsStr);
     } catch (UnresolvedLinkException e) {
       // Exception could be from trg or any src.
       // Fully resolve trg and srcs. Fail if any of them are a symlink.

http://git-wip-us.apache.org/repos/asf/hadoop/blob/68b1abe5/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestHDFSConcat.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestHDFSConcat.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestHDFSConcat.java
index 6d1f452..9647c04 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestHDFSConcat.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestHDFSConcat.java
@@ -387,4 +387,17 @@ public class TestHDFSConcat {
     }
  
   }
+
+  @Test
+  public void testConcatRelativeTargetPath() throws IOException {
+    Path dir = new Path("/dir");
+    Path trg = new Path("trg");
+    Path src = new Path(dir, "src");
+    dfs.setWorkingDirectory(dir);
+    DFSTestUtil.createFile(dfs, trg, blockSize, REPL_FACTOR, 1);
+    DFSTestUtil.createFile(dfs, src, blockSize, REPL_FACTOR, 1);
+    dfs.concat(trg, new Path[]{src});
+    assertEquals(blockSize * 2, dfs.getFileStatus(trg).getLen());
+    assertFalse(dfs.exists(src));
+  }
 }


Mime
View raw message