hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject hadoop git commit: HDFS-9881. DistributedFileSystem#getTrashRoot returns incorrect path for encryption zones.
Date Wed, 02 Mar 2016 00:35:56 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 2c8733a19 -> 90f39b899


HDFS-9881. DistributedFileSystem#getTrashRoot returns incorrect path for encryption zones.

(cherry picked from commit 4abb2fa687a80d2b76f2751dd31513822601b235)
(cherry picked from commit 81b7b9de27300521b26c8598e3b7fbf88805e505)


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

Branch: refs/heads/branch-2.8
Commit: 90f39b899c1f20f94766ed80e031be82181905c2
Parents: 2c8733a
Author: Andrew Wang <wang@apache.org>
Authored: Tue Mar 1 16:35:39 2016 -0800
Committer: Andrew Wang <wang@apache.org>
Committed: Tue Mar 1 16:35:46 2016 -0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hdfs/DistributedFileSystem.java   | 2 +-
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                  | 3 +++
 .../java/org/apache/hadoop/hdfs/TestEncryptionZones.java     | 8 ++++++++
 3 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/90f39b89/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 ce7546e..5bca8a2 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
@@ -2350,7 +2350,7 @@ public class DistributedFileSystem extends FileSystem {
       EncryptionZone ez = dfs.getEZForPath(parentSrc);
       if ((ez != null)) {
         return this.makeQualified(
-            new Path(ez.getPath(), FileSystem.TRASH_PREFIX +
+            new Path(new Path(ez.getPath(), FileSystem.TRASH_PREFIX),
                 dfs.ugi.getShortUserName()));
       }
     } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/90f39b89/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 d26e523..781439e 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -1822,6 +1822,9 @@ Release 2.8.0 - UNRELEASED
     HDFS-9870. Remove unused imports from DFSUtil.
     (Brahma Reddy Battula via cnauroth)
 
+    HDFS-9881. DistributedFileSystem#getTrashRoot returns incorrect path for
+    encryption zones. (wang)
+
 Release 2.7.3 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/90f39b89/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZones.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZones.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZones.java
index 0057c0d..4517f48 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZones.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZones.java
@@ -1445,6 +1445,14 @@ public class TestEncryptionZones {
   private void verifyShellDeleteWithTrash(FsShell shell, Path path)
       throws Exception{
     try {
+      Path trashDir = shell.getCurrentTrashDir(path);
+      // Verify that trashDir has a path component named ".Trash"
+      Path checkTrash = trashDir;
+      while (!checkTrash.isRoot() && !checkTrash.getName().equals(".Trash")) {
+        checkTrash = checkTrash.getParent();
+      }
+      assertEquals("No .Trash component found in trash dir " + trashDir,
+          ".Trash", checkTrash.getName());
       final Path trashFile =
           new Path(shell.getCurrentTrashDir(path) + "/" + path);
       String[] argv = new String[]{"-rm", "-r", path.toString()};


Mime
View raw message