HDFS-7079. Few more unit test fixes for HDFS-6581. (Arpit Agarwal)
This commit is contained in:
parent
a24a9331d4
commit
dcbc467301
@ -473,19 +473,20 @@ 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,
|
||||||
|
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
|
} finally { // might have been created but stream was interrupted
|
||||||
deleteOnExit(item.path);
|
deleteOnExit(item.path);
|
||||||
}
|
}
|
||||||
|
@ -50,4 +50,6 @@
|
|||||||
HDFS-7064. Fix unit test failures in HDFS-6581 branch. (Xiaoyu Yao via
|
HDFS-7064. Fix unit test failures in HDFS-6581 branch. (Xiaoyu Yao via
|
||||||
Arpit Agarwal)
|
Arpit Agarwal)
|
||||||
|
|
||||||
|
HDFS-6581. Few more unit test fixes for HDFS-6581. (Arpit Agarwal)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user