yuruguo commented on a change in pull request #14477:
URL: https://github.com/apache/flink/pull/14477#discussion_r554300858



##########
File path: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManagerDriver.java
##########
@@ -124,6 +125,8 @@ public YarnResourceManagerDriver(
         super(flinkConfig, 
GlobalConfiguration.loadConfiguration(configuration.getCurrentDir()));
 
         this.yarnConfig = new YarnConfiguration();
+        
yarnConfig.addResource(HadoopUtils.getHadoopConfiguration(flinkConfig));
+        yarnConfig.addResource(Utils.getYarnConfiguration(flinkConfig));

Review comment:
       Ok @tillrohrmann, We can slightly modify the `getYarnConfiguration` 
method in the `Utils`  to call 
`HadoopUtils.getHadoopConfiguration(flinkConfig)`, as follows:
   
![image](https://user-images.githubusercontent.com/13013780/104084826-b8d49680-5285-11eb-9f8d-c63dbbef6f0a.png)
   then `getYarnConfiguration` can be reused everywhere needed,as follows:
   in `YarnClusterClientFactory` class
   
![image](https://user-images.githubusercontent.com/13013780/104084904-6e074e80-5286-11eb-9f55-8b2817f320fd.png)
   in `YarnResourceManagerDriver` class
   
![image](https://user-images.githubusercontent.com/13013780/104084932-a149dd80-5286-11eb-9f97-14b83eefe42b.png)
   
   Or another way is to keep the `getYarnConfiguration` method unchanged and 
add a method `loadYarnConfiguration` packing above logic in the `Utils` class, 
as follows:
   
![image](https://user-images.githubusercontent.com/13013780/104085314-4bc30000-5289-11eb-9cb7-f26127e9f344.png)
   then `loadYarnConfiguration` can be reused everywhere needed.
   
   Which one do you think is appropriate? THX!




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


Reply via email to