zjffdu commented on a change in pull request #4116:
URL: https://github.com/apache/zeppelin/pull/4116#discussion_r633582560



##########
File path: 
zeppelin-plugins/launcher/flink/src/main/java/org/apache/zeppelin/interpreter/launcher/FlinkInterpreterLauncher.java
##########
@@ -45,25 +48,44 @@ public FlinkInterpreterLauncher(ZeppelinConfiguration 
zConf, RecoveryStorage rec
           throws IOException {
     Map<String, String> envs = super.buildEnvFromProperties(context);
 
-    String flinkHome = updateEnvsForFlinkHome(envs, context);
-
+    String flinkHome = getFlinkHome(context);
     if (!envs.containsKey("FLINK_CONF_DIR")) {
       envs.put("FLINK_CONF_DIR", flinkHome + "/conf");
     }
     envs.put("FLINK_LIB_DIR", flinkHome + "/lib");
     envs.put("FLINK_PLUGINS_DIR", flinkHome + "/plugins");
 
-    // yarn application mode specific logic
-    if ("yarn-application".equalsIgnoreCase(
-            context.getProperties().getProperty("flink.execution.mode"))) {
-      updateEnvsForYarnApplicationMode(envs, context);
+    String mode = context.getProperties().getProperty("flink.execution.mode");
+    String a = FLINK_EXECUTION_MODES.stream().collect(Collectors.joining(", 
"));
+    if (!FLINK_EXECUTION_MODES.contains(mode)) {
+      throw new IOException("Not valid flink.execution.mode: " +
+              mode + ", valid modes ares: " +
+              FLINK_EXECUTION_MODES.stream().collect(Collectors.joining(", 
")));
+    }
+    if (isApplicationMode(mode)) {
+      updateEnvsForApplicationMode(mode, envs, context);
     }
 
     return envs;
   }
 
-  private String updateEnvsForFlinkHome(Map<String, String> envs,
-                                      InterpreterLaunchContext context) throws 
IOException {
+  private void verifyExecutionMode(String mode) {
+
+  }
+
+  private boolean isApplicationMode(String mode) {
+    return "yarn-application".equals(mode) || 
"kubernetes-application".equals(mode);

Review comment:
       Fixed




-- 
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:
us...@infra.apache.org


Reply via email to