This is an automated email from the ASF dual-hosted git repository.

eyang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new aa24add  HDFS-14890.  Fixed namenode and journalnode startup on 
Windows.              Contributed by Siddharth Wagle
aa24add is described below

commit aa24add8f0e9812d1f787efb3c40155b0fdeed9c
Author: Eric Yang <ey...@apache.org>
AuthorDate: Fri Oct 4 13:13:10 2019 -0400

    HDFS-14890.  Fixed namenode and journalnode startup on Windows.
                 Contributed by Siddharth Wagle
---
 .../java/org/apache/hadoop/hdfs/server/common/Storage.java    | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
index 2ba943a..e7da44e 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
@@ -447,9 +447,14 @@ public abstract class Storage extends StorageInfo {
         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);
+        }
       }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to