HDFS-14890. Fixed namenode and journalnode startup on Windows.

Contributed by Siddharth Wagle
This commit is contained in:
Eric Yang 2019-10-04 13:13:10 -04:00
parent 3f166512af
commit aa24add8f0

View File

@ -447,9 +447,14 @@ public void clearDirectory() throws IOException {
throw new IOException("Cannot create directory " + curDir);
}
if (permission != null) {
try {
Set<PosixFilePermission> permissions =
PosixFilePermissions.fromString(permission.toString());
Files.setPosixFilePermissions(curDir.toPath(), permissions);
} catch (UnsupportedOperationException uoe) {
// Default to FileUtil for non posix file systems
FileUtil.setPermission(curDir, permission);
}
}
}