You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2021/03/11 05:41:50 UTC

[zeppelin] branch master updated: [ZEPPELIN-5267]. Use environment variable FLINK_HOME if it is not specified

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

zjffdu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/master by this push:
     new 4a86a13  [ZEPPELIN-5267]. Use environment variable FLINK_HOME if it is not specified
4a86a13 is described below

commit 4a86a135ac830083ba18e7d049faba2f526e0970
Author: Jeff Zhang <zj...@apache.org>
AuthorDate: Sat Mar 6 18:59:28 2021 +0800

    [ZEPPELIN-5267]. Use environment variable FLINK_HOME if it is not specified
    
    ### What is this PR for?
    
    When `FLINK_HOME` is not in flink interpreter setting, we should use the current environment variable `FLINK_HOME`.
    2 possible use scenario that use `FLINK_HOME` environment variable:
    * Specify `FLINK_HOME` in `zeppelin-env.sh`
    * Mount flink distribution and pass `FLINK_HOME` via docker command
    
    ### What type of PR is it?
    [Improvement]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-5267
    
    ### How should this be tested?
    * Manually tested
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: Jeff Zhang <zj...@apache.org>
    
    Closes #4071 from zjffdu/ZEPPELIN-5267 and squashes the following commits:
    
    97b862842 [Jeff Zhang] [ZEPPELIN-5267]. Use environment variable FLINK_HOME if it is not specified in flink interpreter
---
 .../zeppelin/interpreter/launcher/FlinkInterpreterLauncher.java      | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/zeppelin-plugins/launcher/flink/src/main/java/org/apache/zeppelin/interpreter/launcher/FlinkInterpreterLauncher.java b/zeppelin-plugins/launcher/flink/src/main/java/org/apache/zeppelin/interpreter/launcher/FlinkInterpreterLauncher.java
index dd162b1..32259c5 100644
--- a/zeppelin-plugins/launcher/flink/src/main/java/org/apache/zeppelin/interpreter/launcher/FlinkInterpreterLauncher.java
+++ b/zeppelin-plugins/launcher/flink/src/main/java/org/apache/zeppelin/interpreter/launcher/FlinkInterpreterLauncher.java
@@ -35,7 +35,10 @@ public class FlinkInterpreterLauncher extends StandardInterpreterLauncher {
   public Map<String, String> buildEnvFromProperties(InterpreterLaunchContext context)
           throws IOException {
     Map<String, String> envs = super.buildEnvFromProperties(context);
-    String flinkHome = context.getProperties().getProperty("FLINK_HOME", envs.get("FLINK_HOME"));
+    String flinkHome = context.getProperties().getProperty("FLINK_HOME");
+    if (StringUtils.isBlank(flinkHome)) {
+      flinkHome = System.getenv("FLINK_HOME");
+    }
     if (StringUtils.isBlank(flinkHome)) {
       throw new IOException("FLINK_HOME is not specified");
     }