You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2020/04/07 09:20:55 UTC

[GitHub] [zeppelin] alexott commented on a change in pull request #3719: [ZEPPELIN-4725]. Merge process env into interpreter process env in InterpreterLauncher

alexott commented on a change in pull request #3719: [ZEPPELIN-4725]. Merge process env into interpreter process env in InterpreterLauncher
URL: https://github.com/apache/zeppelin/pull/3719#discussion_r404662671
 
 

 ##########
 File path: zeppelin-plugins/launcher/flink/src/main/java/org/apache/zeppelin/interpreter/launcher/FlinkInterpreterLauncher.java
 ##########
 @@ -34,16 +35,16 @@ public FlinkInterpreterLauncher(ZeppelinConfiguration zConf, RecoveryStorage rec
   public Map<String, String> buildEnvFromProperties(InterpreterLaunchContext context)
           throws IOException {
     Map<String, String> envs = super.buildEnvFromProperties(context);
-    String flinkHome = context.getProperties().getProperty("FLINK_HOME");
-    if (flinkHome == null) {
+    String flinkHome = context.getProperties().getProperty("FLINK_HOME", envs.get("FLINK_HOME"));
+    if (StringUtils.isBlank(flinkHome)) {
       throw new IOException("FLINK_HOME is not specified");
     }
     File flinkHomeFile = new File(flinkHome);
     if (!flinkHomeFile.exists()) {
-      throw new IOException(String.format("FLINK_HOME %s doesn't exist", flinkHome));
+      throw new IOException(String.format("FLINK_HOME '%s' doesn't exist", flinkHome));
     }
     if (flinkHomeFile.isFile()) {
-      throw new IOException(String.format("FLINK_HOME %s is a file, but should be directory",
+      throw new IOException(String.format("FLINK_HOME '%s' is a file, but should be directory",
               flinkHome));
 
 Review comment:
   Instead, I would check for `! flinkHomeFile.isDirectory`, because on Linux/Mac, `isFile` will return `false` for devices, like, `/dev/ttywf`:
   
   ```
   user=> (.isFile (file "/dev/ttywf"))
   false
   user=> (.isDirectory (file "/dev/ttywf"))
   false
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services