xintongsong commented on a change in pull request #9910: [FLINK-14405][runtime] Align ResourceProfile/ResourceSpec fields with the new TaskExecutor memory setups. URL: https://github.com/apache/flink/pull/9910#discussion_r335794168
########## File path: flink-core/src/main/java/org/apache/flink/api/common/operators/ResourceSpec.java ########## @@ -70,72 +70,88 @@ /** How many cpu cores are needed, use double so we can specify cpu like 0.1. */ private final double cpuCores; - /** How many java heap memory in mb are needed. */ - private final int heapMemoryInMB; + /** How many task heap memory are needed. */ Review comment: How about we don't return `Optional` for the getters, but throw an `UnsupportedOperationException` when calling the getters on `UNKNOWN`? We have `Memory.ZERO` for no requirement. If a `ResourceProfile` is not `UNKNOWN`, it should always have explicit values for all the fields. I've made the default constructor private, which should be the only way to set the fields to `null`. Maybe add `checkNotNull` for arguments of all the public constructors? ---------------------------------------------------------------- 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 With regards, Apache Git Services