hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject [39/50] [abbrv] hadoop git commit: HDFS-9431. DistributedFileSystem#concat fails if the target path is relative. Contributed by Kazuho Fujii.
Date Sat, 21 Nov 2015 07:56:43 GMT
HDFS-9431. DistributedFileSystem#concat fails if the target path is relative. Contributed by
Kazuho Fujii.


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

Branch: refs/heads/HDFS-7240
Commit: ac1aa6c8197268ea83f44747199d560be9e299ae
Parents: 25e82b4
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:55:01 2015 +0900

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


http://git-wip-us.apache.org/repos/asf/hadoop/blob/ac1aa6c8/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
index f4ca265..57fac40 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
@@ -581,7 +581,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/ac1aa6c8/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 8862c8a..d857c58 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -3456,6 +3456,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/ac1aa6c8/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 4685eb9..ded0031 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
@@ -490,4 +490,17 @@ public class TestHDFSConcat {
     Assert.assertEquals(blockSize * repl * (srcNum + 1),
         summary.getSpaceConsumed());
   }
+
+  @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