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/05/18 02:06:37 UTC

[zeppelin] branch branch-0.9 updated: [ZEPPELIN-5368] No pyflink jars will cause flink interpreter fails to launch for flink 1.10/1.11

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

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


The following commit(s) were added to refs/heads/branch-0.9 by this push:
     new 12f6cc9  [ZEPPELIN-5368] No pyflink jars will cause flink interpreter fails to launch for flink 1.10/1.11
12f6cc9 is described below

commit 12f6cc9785e0bdef96e6bb7771043c613a0ab17a
Author: Jeff Zhang <zj...@apache.org>
AuthorDate: Fri May 14 14:48:50 2021 +0800

    [ZEPPELIN-5368] No pyflink jars will cause flink interpreter fails to launch for flink 1.10/1.11
    
    ### What is this PR for?
    
    pyflink jars is not in the flink lib folder by default. So if users don't put it under lib folder, flink interpreter will fail to launch. `Flink112Shims` and `Flink113Shims` has already fix that by catch the `NoClassDefFoundError`, but we haven't done that for flink 1.10 and 1.11, this PR fix it in `Flink110Shims` and `Flink111Shims`
    
    ### What type of PR is it?
    [Bug Fix]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-5368
    
    ### How should this be tested?
    * CI pass and 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 #4117 from zjffdu/ZEPPELIN-5368 and squashes the following commits:
    
    2ef10a93c9 [Jeff Zhang] [ZEPPELIN-5368] No pyflink jars will cause flink interpreter fails to launch for flink 1.10/1.11
    
    (cherry picked from commit 97ce203a7fb72fd0300ff84ea5fa8e52f6125ebc)
    Signed-off-by: Jeff Zhang <zj...@apache.org>
---
 .../src/main/java/org/apache/zeppelin/flink/Flink110Shims.java      | 6 +++++-
 .../src/main/java/org/apache/zeppelin/flink/Flink111Shims.java      | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/flink/flink1.10-shims/src/main/java/org/apache/zeppelin/flink/Flink110Shims.java b/flink/flink1.10-shims/src/main/java/org/apache/zeppelin/flink/Flink110Shims.java
index 4eaa905..9a03b95 100644
--- a/flink/flink1.10-shims/src/main/java/org/apache/zeppelin/flink/Flink110Shims.java
+++ b/flink/flink1.10-shims/src/main/java/org/apache/zeppelin/flink/Flink110Shims.java
@@ -296,7 +296,11 @@ public class Flink110Shims extends FlinkShims {
     Map<String, ConfigOption> configOptions = new HashMap<>();
     configOptions.putAll(extractConfigOptions(ExecutionConfigOptions.class));
     configOptions.putAll(extractConfigOptions(OptimizerConfigOptions.class));
-    configOptions.putAll(extractConfigOptions(PythonOptions.class));
+    try {
+      configOptions.putAll(extractConfigOptions(PythonOptions.class));
+    } catch (NoClassDefFoundError e) {
+      LOGGER.warn("No pyflink jars found");
+    }
     return configOptions;
   }
 
diff --git a/flink/flink1.11-shims/src/main/java/org/apache/zeppelin/flink/Flink111Shims.java b/flink/flink1.11-shims/src/main/java/org/apache/zeppelin/flink/Flink111Shims.java
index 5cfd280..f290fad 100644
--- a/flink/flink1.11-shims/src/main/java/org/apache/zeppelin/flink/Flink111Shims.java
+++ b/flink/flink1.11-shims/src/main/java/org/apache/zeppelin/flink/Flink111Shims.java
@@ -443,7 +443,11 @@ public class Flink111Shims extends FlinkShims {
     Map<String, ConfigOption> configOptions = new HashMap<>();
     configOptions.putAll(extractConfigOptions(ExecutionConfigOptions.class));
     configOptions.putAll(extractConfigOptions(OptimizerConfigOptions.class));
-    configOptions.putAll(extractConfigOptions(PythonOptions.class));
+    try {
+      configOptions.putAll(extractConfigOptions(PythonOptions.class));
+    } catch (NoClassDefFoundError e) {
+      LOGGER.warn("No pyflink jars found");
+    }
     configOptions.putAll(extractConfigOptions(TableConfigOptions.class));
     return configOptions;
   }