From dcbc46730131a1bdf8416efeb4571794e5c8e369 Mon Sep 17 00:00:00 2001 From: arp Date: Tue, 16 Sep 2014 18:19:57 -0700 Subject: [PATCH] HDFS-7079. Few more unit test fixes for HDFS-6581. (Arpit Agarwal) --- .../fs/shell/CommandWithDestination.java | 23 ++++++++++--------- .../hadoop-hdfs/CHANGES-HDFS-6581.txt | 2 ++ 2 files changed, 14 insertions(+), 11 deletions(-) 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 7152f02d3a6..65e52fd3b0b 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 @@ -473,19 +473,20 @@ abstract class CommandWithDestination extends FsCommand { FSDataOutputStream create(PathData item, boolean lazyPersist) throws IOException { try { - EnumSet createFlags = EnumSet.of(CREATE); if (lazyPersist) { - createFlags.add(LAZY_PERSIST); + EnumSet createFlags = EnumSet.of(CREATE, LAZY_PERSIST); + return create(item.path, + FsPermission.getFileDefault().applyUMask( + FsPermission.getUMask(getConf())), + createFlags, + getConf().getInt("io.file.buffer.size", 4096), + lazyPersist ? 1 : getDefaultReplication(item.path), + getDefaultBlockSize(), + null, + null); + } else { + return create(item.path, true); } - return create(item.path, - FsPermission.getFileDefault().applyUMask( - FsPermission.getUMask(getConf())), - createFlags, - getConf().getInt("io.file.buffer.size", 4096), - lazyPersist ? 1 : getDefaultReplication(item.path), - getDefaultBlockSize(), - null, - null); } finally { // might have been created but stream was interrupted deleteOnExit(item.path); } diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt index f6c8672b1d5..e1f51c1b176 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt @@ -50,4 +50,6 @@ HDFS-7064. Fix unit test failures in HDFS-6581 branch. (Xiaoyu Yao via Arpit Agarwal) + HDFS-6581. Few more unit test fixes for HDFS-6581. (Arpit Agarwal) +