wangyang0918 commented on a change in pull request #12444:
URL: https://github.com/apache/flink/pull/12444#discussion_r434265825
##########
File path:
flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java
##########
@@ -508,7 +508,9 @@ public void killCluster(ApplicationId applicationId) throws
FlinkException {
throw new YarnDeploymentException("Could not retrieve
information about free cluster resources.", e);
}
- final int yarnMinAllocationMB =
yarnConfiguration.getInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB,
0);
+ final int yarnMinAllocationMB = yarnConfiguration.getInt(
Review comment:
The pre-check could be moved as following of `yarnMinAllocationMB `
definition. And use `Preconditions.checkArgument` instead. Then the whole
changes could be like following.
```
final int yarnMinAllocationMB =
yarnConfiguration.getInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB,
YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB);
Preconditions.checkArgument(yarnMinAllocationMB > 0, "The minimum allocation
memory ({} MB, configured via 'yarn.scheduler.minimum-allocation-mb') should be
greater than 0.");
```
----------------------------------------------------------------
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:
[email protected]