HDFS-7079. Few more unit test fixes for HDFS-6581. (Arpit Agarwal)
Conflicts: hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt
This commit is contained in:
parent
5f86ce7ea9
commit
e4ef0023b8
|
@ -473,10 +473,8 @@ 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())),
|
||||
|
@ -486,6 +484,9 @@ abstract class CommandWithDestination extends FsCommand {
|
|||
getDefaultBlockSize(),
|
||||
null,
|
||||
null);
|
||||
} else {
|
||||
return create(item.path, true);
|
||||
}
|
||||
} finally { // might have been created but stream was interrupted
|
||||
deleteOnExit(item.path);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue