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_r354174053
 
 

 ##########
 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:
   If the method accepts a general option to fallback to, then there is no 
dependency on yarn/mesos in `TaskExecutorResourceUtils`.

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


With regards,
Apache Git Services

Reply via email to