xintongsong commented on a change in pull request #13397: URL: https://github.com/apache/flink/pull/13397#discussion_r489915944
########## File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGenerator.java ########## @@ -849,26 +843,23 @@ private static void setManagedMemoryFractionForSlotSharingGroup( } private static void setManagedMemoryFractionForOperator( - final ResourceSpec operatorResourceSpec, final ResourceSpec groupResourceSpec, final int operatorManagedMemoryWeight, final int groupManagedMemoryWeight, final StreamConfig operatorConfig) { - final double managedMemoryFraction; - if (groupResourceSpec.equals(ResourceSpec.UNKNOWN)) { - managedMemoryFraction = groupManagedMemoryWeight > 0 - ? getFractionRoundedDown(operatorManagedMemoryWeight, groupManagedMemoryWeight) - : 0.0; + operatorConfig.setManagedMemoryFraction( + groupManagedMemoryWeight > 0 ? + getFractionRoundedDown(operatorManagedMemoryWeight, groupManagedMemoryWeight) : + 0.0); } else { - final long groupManagedMemoryBytes = groupResourceSpec.getManagedMemory().getBytes(); - managedMemoryFraction = groupManagedMemoryBytes > 0 - ? getFractionRoundedDown(operatorResourceSpec.getManagedMemory().getBytes(), groupManagedMemoryBytes) - : 0.0; + // Supporting for fine grained resource specs is still under developing. + // This branch should not be executed in production. Not throwing exception for testing purpose. + LOG.error("Failed setting managed memory fractions. " + + " Operators may not be able to use managed memory properly." + + " Calculating managed memory fractions with fine grained resource spec is currently not supported."); Review comment: FYI, I've created FLINK-19267 to track the fraction calculation issue for fine grained resource specs. ---------------------------------------------------------------- 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