You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/11/20 13:24:48 UTC

[GitHub] [flink] azagrebin commented on a change in pull request #10146: [FLINK-14188][runtime] TaskExecutor derive and register with default slot resource profile

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_r348366164
 
 

 ##########
 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:
   we could already introduce a helper function to create `taskExecutorResourceSpec`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services