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



##########
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
   
   I know what you said. But if the user sets the 
`taskmanager.memory.process.size` value referring to the manual (flink.md line 
114~116), there is a high probability that "mb" is not attached to the set 
value.
   
   In this case, I ask if it is necessary to check the newKey setting value and 
add "mb".




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to