HDFS-14890. Fixed namenode and journalnode startup on Windows.
Contributed by Siddharth Wagle (cherry picked from commit aa24add8f0e9812d1f787efb3c40155b0fdeed9c) (cherry picked from commit 8bb2b00d38978859b22b892034eb3f559b820942)
This commit is contained in:
parent
c61c114a3d
commit
166d38ceaa
@ -447,9 +447,14 @@ public void clearDirectory() throws IOException {
|
||||
throw new IOException("Cannot create directory " + curDir);
|
||||
}
|
||||
if (permission != null) {
|
||||
Set<PosixFilePermission> permissions =
|
||||
PosixFilePermissions.fromString(permission.toString());
|
||||
Files.setPosixFilePermissions(curDir.toPath(), permissions);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user