hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject hadoop git commit: HDFS-9844. Correct path creation in getTrashRoot to handle root dir.
Date Tue, 23 Feb 2016 21:30:57 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 6f3f5a8c3 -> bab4fb55c


HDFS-9844. Correct path creation in getTrashRoot to handle root dir.

Change-Id: I5afe6c7176063892e3e632698c849bd9f4b92906


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

Branch: refs/heads/branch-2.8
Commit: bab4fb55c932e58a64f5e0775d4b340792bba447
Parents: 6f3f5a8
Author: Zhe Zhang <zhz@apache.org>
Authored: Tue Feb 23 13:29:39 2016 -0800
Committer: Zhe Zhang <zhz@apache.org>
Committed: Tue Feb 23 13:30:47 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/hadoop/blob/bab4fb55/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 e2449c7..ce7546e 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(ez.getPath(), FileSystem.TRASH_PREFIX +
                 dfs.ugi.getShortUserName()));
       }
     } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/bab4fb55/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 9128aa6..4b3dd5a 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -927,6 +927,8 @@ Release 2.8.0 - UNRELEASED
     HDFS-9084. Pagination, sorting and filtering of files/directories in the
     HDFS Web UI. (Ravi Prakash via ozawa)
 
+    HDFS-9844. Correct path creation in getTrashRoot to handle root dir. (zhz)
+
   OPTIMIZATIONS
 
     HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

http://git-wip-us.apache.org/repos/asf/hadoop/blob/bab4fb55/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 551c333..0057c0d 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
@@ -1428,6 +1428,20 @@ public class TestEncryptionZones {
     verifyShellDeleteWithTrash(shell, topEZ);
   }
 
+  @Test(timeout = 120000)
+  public void testRootDirEZTrash() throws Exception {
+    final HdfsAdmin dfsAdmin =
+        new HdfsAdmin(FileSystem.getDefaultUri(conf), conf);
+    dfsAdmin.createEncryptionZone(new Path("/"), TEST_KEY);
+    final Path encFile = new Path("/encFile");
+    final int len = 8192;
+    DFSTestUtil.createFile(fs, encFile, len, (short) 1, 0xFEED);
+    Configuration clientConf = new Configuration(conf);
+    clientConf.setLong(FS_TRASH_INTERVAL_KEY, 1);
+    FsShell shell = new FsShell(clientConf);
+    verifyShellDeleteWithTrash(shell, encFile);
+  }
+
   private void verifyShellDeleteWithTrash(FsShell shell, Path path)
       throws Exception{
     try {


Mime
View raw message