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_r348390740
 
 

 ##########
 File path: 
flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosTaskManagerParameters.java
 ##########
 @@ -336,20 +336,22 @@ public String toString() {
        public static MesosTaskManagerParameters create(Configuration 
flinkConfig) {
 
                List<ConstraintEvaluator> constraints = 
parseConstraints(flinkConfig.getString(MESOS_CONSTRAINTS_HARD_HOSTATTR));
+
+               int numberOfSlot = flinkConfig.getInteger(MESOS_RM_TASKS_SLOTS);
+
+               double cpus = flinkConfig.getDouble(MESOS_RM_TASKS_CPUS);
+               if (cpus <= 0.0) {
+                       cpus = Math.max(numberOfSlot, 1.0);
+               }
+
                MemorySize totalProcessMemory = 
MemorySize.parse(flinkConfig.getInteger(MESOS_RM_TASKS_MEMORY_MB) + "m");
-               TaskExecutorResourceSpec taskExecutorResourceSpec =
-                       
TaskExecutorResourceUtils.resourceSpecFromConfig(flinkConfig, 
totalProcessMemory);
+               TaskExecutorResourceSpec taskExecutorResourceSpec = 
TaskExecutorResourceUtils.resourceSpecFromConfig(flinkConfig, cpus, 
totalProcessMemory);
 
 Review comment:
   should we also add some test covering this change in 
`MesosTaskManagerParametersTest`?

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