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
d3ccbd8e65
commit
7d168d9ff9
@ -473,10 +473,8 @@ void writeStreamToFile(InputStream in, PathData target,
|
|||||||
FSDataOutputStream create(PathData item, boolean lazyPersist)
|
FSDataOutputStream create(PathData item, boolean lazyPersist)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
try {
|
try {
|
||||||
EnumSet<CreateFlag> createFlags = EnumSet.of(CREATE);
|
|
||||||
if (lazyPersist) {
|
if (lazyPersist) {
|
||||||
createFlags.add(LAZY_PERSIST);
|
EnumSet<CreateFlag> createFlags = EnumSet.of(CREATE, LAZY_PERSIST);
|
||||||
}
|
|
||||||
return create(item.path,
|
return create(item.path,
|
||||||
FsPermission.getFileDefault().applyUMask(
|
FsPermission.getFileDefault().applyUMask(
|
||||||
FsPermission.getUMask(getConf())),
|
FsPermission.getUMask(getConf())),
|
||||||
@ -486,6 +484,9 @@ FSDataOutputStream create(PathData item, boolean lazyPersist)
|
|||||||
getDefaultBlockSize(),
|
getDefaultBlockSize(),
|
||||||
null,
|
null,
|
||||||
null);
|
null);
|
||||||
|
} else {
|
||||||
|
return create(item.path, true);
|
||||||
|
}
|
||||||
} finally { // might have been created but stream was interrupted
|
} finally { // might have been created but stream was interrupted
|
||||||
deleteOnExit(item.path);
|
deleteOnExit(item.path);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user