hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject git commit: HDFS-7064. Fix unit test failures in HDFS-6581 branch. (Contributed by Xiaoyu Yao)
Date Tue, 16 Sep 2014 22:45:45 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-6581 e0d7fb48f -> 4603e4481


HDFS-7064. Fix unit test failures in HDFS-6581 branch. (Contributed by Xiaoyu Yao)


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

Branch: refs/heads/HDFS-6581
Commit: 4603e4481f0486afcce6b106d4a92a6e90e5b6d9
Parents: e0d7fb4
Author: arp <arp@apache.org>
Authored: Tue Sep 16 15:45:07 2014 -0700
Committer: arp <arp@apache.org>
Committed: Tue Sep 16 15:45:07 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/fs/shell/CommandWithDestination.java | 3 ++-
 hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt           | 4 ++++
 .../hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java       | 5 +++--
 .../org/apache/hadoop/hdfs/server/datanode/TestDataDirs.java    | 2 +-
 4 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4603e448/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/CommandWithDestination.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/CommandWithDestination.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/CommandWithDestination.java
index 5d0d9d6..7152f02 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/CommandWithDestination.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/CommandWithDestination.java
@@ -478,7 +478,8 @@ abstract class CommandWithDestination extends FsCommand {
           createFlags.add(LAZY_PERSIST);
         }
         return create(item.path,
-                      null,
+                      FsPermission.getFileDefault().applyUMask(
+                          FsPermission.getUMask(getConf())),
                       createFlags,
                       getConf().getInt("io.file.buffer.size", 4096),
                       lazyPersist ? 1 : getDefaultReplication(item.path),

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4603e448/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt
index 0877636..f6c8672 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt
@@ -47,3 +47,7 @@
     HDFS-7066. LazyWriter#evictBlocks misses a null check for replicaState.
     (Xiaoyu Yao via Arpit Agarwal)
 
+    HDFS-7064. Fix unit test failures in HDFS-6581 branch. (Xiaoyu Yao via
+    Arpit Agarwal)
+
+

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4603e448/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
index 276aa5b..149ca27 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
@@ -381,8 +381,9 @@ public class FsVolumeImpl implements FsVolumeSpi {
           !FileUtil.fullyDelete(finalizedDir)) {
         throw new IOException("Failed to delete " + finalizedDir);
       }
-      if (!DatanodeUtil.dirNoFilesRecursive(lazypersistDir) ||
-          !FileUtil.fullyDelete(lazypersistDir)) {
+      if (lazypersistDir.exists() &&
+        ((!DatanodeUtil.dirNoFilesRecursive(lazypersistDir) ||
+          !FileUtil.fullyDelete(lazypersistDir)))) {
         throw new IOException("Failed to delete " + lazypersistDir);
       }
       FileUtil.fullyDelete(tmpDir);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4603e448/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataDirs.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataDirs.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataDirs.java
index c0b4f9a..94af015 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataDirs.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataDirs.java
@@ -51,7 +51,7 @@ public class TestDataDirs {
     String locations1 = "[disk]/dir0,[DISK]/dir1,[sSd]/dir2,[disK]/dir3,[ram_disk]/dir4";
     conf.set(DFS_DATANODE_DATA_DIR_KEY, locations1);
     locations = DataNode.getStorageLocations(conf);
-    assertThat(locations.size(), is(4));
+    assertThat(locations.size(), is(5));
     assertThat(locations.get(0).getStorageType(), is(StorageType.DISK));
     assertThat(locations.get(0).getUri(), is(dir0.toURI()));
     assertThat(locations.get(1).getStorageType(), is(StorageType.DISK));


Mime
View raw message