HDFS-14890. Fixed namenode and journalnode startup on Windows.
Contributed by Siddharth Wagle
(cherry picked from commit aa24add8f0
)
This commit is contained in:
parent
673c9d53ca
commit
8bb2b00d38
|
@ -447,9 +447,14 @@ public abstract class Storage extends StorageInfo {
|
||||||
throw new IOException("Cannot create directory " + curDir);
|
throw new IOException("Cannot create directory " + curDir);
|
||||||
}
|
}
|
||||||
if (permission != null) {
|
if (permission != null) {
|
||||||
Set<PosixFilePermission> permissions =
|
try {
|
||||||
PosixFilePermissions.fromString(permission.toString());
|
Set<PosixFilePermission> permissions =
|
||||||
Files.setPosixFilePermissions(curDir.toPath(), 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue