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

 ##########
 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 would try to avoid adding any yarn / mesos specific codes in 
`TaskExecutorResourceUtils`.
   - I'm in favor of keeping `TaskExecutorResourceUtils` for general common 
purpose only.
   - Parsing mesos / yarn config options will introduce extra dependencies on 
flink-yarn / flink-mesos into flink-runtime.

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