azagrebin commented on a change in pull request #10146: [FLINK-14188][runtime] 
TaskExecutor derive and register with default slot resource profile
URL: https://github.com/apache/flink/pull/10146#discussion_r353832021
 
 

 ##########
 File path: 
flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosTaskManagerParameters.java
 ##########
 @@ -419,6 +411,34 @@ public static MesosTaskManagerParameters 
create(Configuration flinkConfig) {
                        uris);
        }
 
+       private static ContaineredTaskManagerParameters 
createContaineredTaskManagerParameters (final Configuration flinkConfig) {
+               double cpus = getCpuCores(flinkConfig);
+               MemorySize totalProcessMemory = 
MemorySize.parse(flinkConfig.getInteger(MESOS_RM_TASKS_MEMORY_MB) + "m");
+               TaskExecutorResourceSpec taskExecutorResourceSpec = 
TaskExecutorResourceUtils
+                       .newResourceSpecBuilder(flinkConfig)
+                       .withCpuCores(cpus)
+                       .withTotalProcessMemory(totalProcessMemory)
+                       .build();
+
+               return ContaineredTaskManagerParameters.create(flinkConfig, 
taskExecutorResourceSpec);
+       }
+
+       private static double getCpuCores(final Configuration configuration) {
 
 Review comment:
   I think we can unify this function in 
`TaskExecutorResourceUtils#getCpuCores` adding a nullable optional option, to 
fallback to (for yarn and mesos but none for standalone), before falling back 
to fraction/number of slots.

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


With regards,
Apache Git Services

Reply via email to