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_r351887603
 
 

 ##########
 File path: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java
 ##########
 @@ -186,9 +186,16 @@ public YarnResourceManager(
                this.webInterfaceUrl = webInterfaceUrl;
                this.numberOfTaskSlots = 
flinkConfig.getInteger(TaskManagerOptions.NUM_TASK_SLOTS);
 
-               this.taskExecutorResourceSpec = 
TaskExecutorResourceUtils.resourceSpecFromConfig(flinkConfig);
+               double configuredCpu = 
flinkConfig.getDouble(TaskManagerOptions.CPU_CORES);
+               if (configuredCpu <= 0.0) {
+                       configuredCpu = 
flinkConfig.getInteger(YarnConfigOptions.VCORES);
+               }
+               this.defaultCpus = configuredCpu > 0.0 ? (int) configuredCpu : 
flinkConfig.getInteger(YarnConfigOptions.VCORES, numberOfTaskSlots);
 
 Review comment:
   we should have a function to derive `defaultCpus`

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