KarmaGYZ commented on a change in pull request #14865:
URL: https://github.com/apache/flink/pull/14865#discussion_r571517144



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/ExecutionVertexSchedulingRequirementsMapper.java
##########
@@ -52,17 +52,22 @@ public static ExecutionVertexSchedulingRequirements from(
     /**
      * Get resource profile of the physical slot to allocate a logical slot in 
for the given vertex.
      * If the vertex is in a slot sharing group, the physical slot resource 
profile should be the
-     * resource profile of the slot sharing group. Otherwise it should be the 
resource profile of
-     * the vertex itself since the physical slot would be used by this vertex 
only in this case.
+     * resource profile of the slot sharing group if present. Otherwise it 
should be the resource
+     * profile of the vertex itself since the physical slot would be used by 
this vertex only in
+     * this case.
      *
      * @return resource profile of the physical slot to allocate a logical 
slot for the given vertex
      */
     public static ResourceProfile getPhysicalSlotResourceProfile(
             final ExecutionVertex executionVertex) {
         final SlotSharingGroup slotSharingGroup =
                 executionVertex.getJobVertex().getSlotSharingGroup();
-        return ResourceProfile.fromResourceSpec(
-                slotSharingGroup.getResourceSpec(), MemorySize.ZERO);
+        if 
(slotSharingGroup.getResourceProfile().equals(ResourceProfile.UNKNOWN)) {
+            return ResourceProfile.fromResourceSpec(
+                    slotSharingGroup.getResourceSpec(), MemorySize.ZERO);

Review comment:
       You are right, this class will be removed in #14862 . For the removal of 
`SlotSharingGroup#resourceSpec`, I tend to move it to another ticket.




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


Reply via email to