xintongsong commented on a change in pull request #11675: [FLINK-16745] Use JobManagerProcessUtils to start JM container and pass JVM memory args URL: https://github.com/apache/flink/pull/11675#discussion_r407346335
########## File path: flink-clients/src/main/java/org/apache/flink/client/deployment/ClusterSpecification.java ########## @@ -18,20 +18,35 @@ package org.apache.flink.client.deployment; +import org.apache.flink.runtime.jobmanager.JobManagerProcessSpec; +import org.apache.flink.util.Preconditions; + +import static org.apache.flink.runtime.jobmanager.JobManagerProcessUtils.createDefaultJobManagerProcessSpec; + /** * Description of the cluster to start by the {@link ClusterDescriptor}. */ public final class ClusterSpecification { + private final JobManagerProcessSpec masterProcessSpec; Review comment: I'm not sure about adding `JobManagerProcessSpec` into `ClusterSpecification`. Actually, I was thinking about removing `ClusterSpecification`. After FLIP-116, all the information that `ClusterSpecification` carries can derived from configuration. We don't really need this data structure to hold the information, with the risk of potential inconsistency due to using `MB`. Please see FLINK-16734 for more details. Removing `ClusterSpecification` involves refactoring `ClusterDescriptor`, which is not necessary for this PR. But I would suggest to not add more usages to it. I think we can do the same thing for `masterMemoryMB` as we did for `taskManagerMemoryMB`: - Make `JavaCmdJobManagerDecorator#decorateFlinkPod` and `YarnClusterDescriptor#startAppMaster` derive `JobManagerProcessSpec` from configuration. - Leave it for `YarnClusterDescriptor#validateClusterResources`, but do not try to overwrite `jobManagerMemoryMb` when it is smaller than `yarnMinAllocationMB`. WDYT? ---------------------------------------------------------------- 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