Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.7 08c1c9fe9 -> 2ec379ff6


[ZEPPELIN-2382] Fixed windows compatibility of interpreter binding.

### What is this PR for?
Fixing ZEPPELIN-2382:

A fresh install of Zeppelin 0.7.1 failed to start on a Windows due to the use 
of 
[getPosixFilePermissions](https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#getPosixFilePermissions(java.nio.file.Path,%20java.nio.file.LinkOption...))

This method fails on Windows with an UnsupportedOperationException - however, 
recovering (that is ignoring the exception) appears to have no negative 
effects. (For a discussion on this related to a different project see, e.g., 
https://github.com/GoogleCloudPlatform/google-cloud-intellij/issues/937 )

### What type of PR is it?
[Bug Fix]

### Todos
* [x] - Have the binary distribution checked by the reporter of [ZEPPELIN-2382]

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2382

### How should this be tested?
Check if clean distribution runs on Windows. Important: Ensure that HADOOP_HOME 
points to a folder containing bin/winutils.exe since this pull request does not 
include a fix for https://issues.apache.org/jira/browse/ZEPPELIN-2438 (which is 
part of a separate pull request).

### Screenshots (if appropriate)
N/A

### Questions:
* Does the licenses files need update?
No

* Is there breaking changes for older versions?
No

* Does this needs documentation?
No

Author: Christian Fries <[email protected]>

Closes #2305 from cfries/windows-compatiblity-interpreter-binding and squashes 
the following commits:

e3b5738 [Christian Fries] Added graceful exception handling if posix permission 
is not available
096fed6 [Christian Fries] Merge branch 'master' into apache/master
3635ed8 [Christian Fries] [ZEPPELIN-2375]: Avoid modification of CLASSPATH 
variable.

(cherry picked from commit fb80bf7dd9cfe6ca5ff649d249a09c03f09ca166)
Signed-off-by: Lee moon soo <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/2ec379ff
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/2ec379ff
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/2ec379ff

Branch: refs/heads/branch-0.7
Commit: 2ec379ff61d10fb9b8e5b2808170793c86b930d7
Parents: 08c1c9f
Author: Christian Fries <[email protected]>
Authored: Sun Apr 30 21:44:12 2017 +0200
Committer: Lee moon soo <[email protected]>
Committed: Sat May 6 15:00:36 2017 -0400

----------------------------------------------------------------------
 .../zeppelin/interpreter/InterpreterSettingManager.java     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/2ec379ff/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java
----------------------------------------------------------------------
diff --git 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java
 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java
index 9b8dbec..9ee8ffb 100644
--- 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java
+++ 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java
@@ -236,8 +236,13 @@ public class InterpreterSettingManager {
     if (!Files.exists(interpreterBindingPath)) {
       Files.createFile(interpreterBindingPath);
 
-      Set<PosixFilePermission> permissions = EnumSet.of(OWNER_READ, 
OWNER_WRITE);
-      Files.setPosixFilePermissions(interpreterBindingPath, permissions);
+      try {
+        Set<PosixFilePermission> permissions = EnumSet.of(OWNER_READ, 
OWNER_WRITE);
+        Files.setPosixFilePermissions(interpreterBindingPath, permissions);
+      } catch (UnsupportedOperationException e) {
+        // File system does not support Posix file permissions (likely 
windows) - continue anyway.
+        logger.warn("unable to setPosixFilePermissions on '{}'.", 
interpreterBindingPath);
+      };
     }
 
     FileOutputStream fos = new 
FileOutputStream(interpreterBindingPath.toFile(), false);

Reply via email to