HDFS-7079. Few more unit test fixes for HDFS-6581. (Arpit Agarwal)
Conflicts:
hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e4ef0023
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e4ef0023
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e4ef0023
Branch: refs/heads/branch-2
Commit: e4ef0023b88c443f9ba6f6c427cc0548e895b5ab
Parents: 5f86ce7
Author: arp <[email protected]>
Authored: Tue Sep 16 18:19:57 2014 -0700
Committer: Jitendra Pandey <[email protected]>
Committed: Fri Oct 17 13:42:02 2014 -0700
----------------------------------------------------------------------
.../hadoop/fs/shell/CommandWithDestination.java | 23 ++++++++++----------
1 file changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/e4ef0023/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 7152f02..65e52fd 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<CreateFlag> createFlags = EnumSet.of(CREATE);
if (lazyPersist) {
- createFlags.add(LAZY_PERSIST);
+ EnumSet<CreateFlag> 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);
}