You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "morhidi (via GitHub)" <gi...@apache.org> on 2023/09/12 17:53:16 UTC

[GitHub] [flink-kubernetes-operator] morhidi commented on a diff in pull request #670: [FLINK-31871] Interpret Flink MemoryUnits according to the actual user input

morhidi commented on code in PR #670:
URL: https://github.com/apache/flink-kubernetes-operator/pull/670#discussion_r1323380347


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/FlinkConfigBuilder.java:
##########
@@ -420,13 +421,24 @@ private void setResource(Resource resource, Configuration effectiveConfig, boole
                             ? JobManagerOptions.TOTAL_PROCESS_MEMORY
                             : TaskManagerOptions.TOTAL_PROCESS_MEMORY;
             if (resource.getMemory() != null) {
-                effectiveConfig.setString(memoryConfigOption.key(), resource.getMemory());
+                effectiveConfig.setString(
+                        memoryConfigOption.key(), parseResourceMemoryString(resource.getMemory()));
             }
 
             configureCpu(resource, effectiveConfig, isJM);
         }
     }
 
+    // Using the K8s units specification for the JM and TM memory settings
+    private String parseResourceMemoryString(String memory) {
+        try {
+            return MemorySize.parse(memory).toString();

Review Comment:
   Mmm in my head we should aim to support all memory configurations and notations kubernetes supports and convert them to Flinks proprietary settings unless those are specifically provided by Flink properties.



-- 
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: issues-unsubscribe@flink.apache.org

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