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 2021/06/28 02:30:37 UTC

[GitHub] [zeppelin] zjffdu commented on a change in pull request #4155: [ZEPPELIN-5428] Unify flink configuration between different execution modes

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



##########
File path: zeppelin-plugins/launcher/flink/src/main/java/org/apache/zeppelin/interpreter/launcher/FlinkInterpreterLauncher.java
##########
@@ -66,6 +69,30 @@ public FlinkInterpreterLauncher(ZeppelinConfiguration zConf, RecoveryStorage rec
     return envs;
   }
 
+  // do mapping between configuration of different execution modes.
+  private void normalizeConfiguration(InterpreterLaunchContext context) {
+    Properties intpProperties = context.getProperties();
+    setNewProperty(intpProperties, "flink.jm.memory", "jobmanager.memory.process.size", true);
+    setNewProperty(intpProperties, "flink.tm.memory", "taskmanager.memory.process.size", true);
+    setNewProperty(intpProperties, "flink.tm.slot", "taskmanager.numberOfTaskSlots", false);
+    setNewProperty(intpProperties, "flink.yarn.appName", "yarn.application.name", false);
+    setNewProperty(intpProperties, "flink.yarn.queue", "yarn.application.queue", false);
+  }
+
+  private void setNewProperty(Properties properties,
+                              String oldKey,
+                              String newKey,
+                              boolean isMemoryProperty) {
+    String value = properties.getProperty(oldKey);
+    if (StringUtils.isNotBlank(value) && !properties.containsKey(newKey)) {
+      if (isMemoryProperty) {
+        properties.put(newKey, value + "mb");
+      } else {
+        properties.put(newKey, value);
+      }
+    }

Review comment:
       The conversion here only happens when there's no new key exists. 
   So the order is newKey > oldKey




-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org