HDFS-7064. Fix unit test failures in HDFS-6581 branch. (Contributed by Xiaoyu Yao)
Conflicts: hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt
This commit is contained in:
parent
14edbc9419
commit
5f86ce7ea9
|
@ -478,7 +478,8 @@ abstract class CommandWithDestination extends FsCommand {
|
|||
createFlags.add(LAZY_PERSIST);
|
||||
}
|
||||
return create(item.path,
|
||||
null,
|
||||
FsPermission.getFileDefault().applyUMask(
|
||||
FsPermission.getUMask(getConf())),
|
||||
createFlags,
|
||||
getConf().getInt("io.file.buffer.size", 4096),
|
||||
lazyPersist ? 1 : getDefaultReplication(item.path),
|
||||
|
|
|
@ -381,8 +381,9 @@ public class FsVolumeImpl implements FsVolumeSpi {
|
|||
!FileUtil.fullyDelete(finalizedDir)) {
|
||||
throw new IOException("Failed to delete " + finalizedDir);
|
||||
}
|
||||
if (!DatanodeUtil.dirNoFilesRecursive(lazypersistDir) ||
|
||||
!FileUtil.fullyDelete(lazypersistDir)) {
|
||||
if (lazypersistDir.exists() &&
|
||||
((!DatanodeUtil.dirNoFilesRecursive(lazypersistDir) ||
|
||||
!FileUtil.fullyDelete(lazypersistDir)))) {
|
||||
throw new IOException("Failed to delete " + lazypersistDir);
|
||||
}
|
||||
FileUtil.fullyDelete(tmpDir);
|
||||
|
|
|
@ -51,7 +51,7 @@ public class TestDataDirs {
|
|||
String locations1 = "[disk]/dir0,[DISK]/dir1,[sSd]/dir2,[disK]/dir3,[ram_disk]/dir4";
|
||||
conf.set(DFS_DATANODE_DATA_DIR_KEY, locations1);
|
||||
locations = DataNode.getStorageLocations(conf);
|
||||
assertThat(locations.size(), is(4));
|
||||
assertThat(locations.size(), is(5));
|
||||
assertThat(locations.get(0).getStorageType(), is(StorageType.DISK));
|
||||
assertThat(locations.get(0).getUri(), is(dir0.toURI()));
|
||||
assertThat(locations.get(1).getStorageType(), is(StorageType.DISK));
|
||||
|
|
Loading…
Reference in New Issue