deniskuzZ commented on code in PR #5809:
URL: https://github.com/apache/hive/pull/5809#discussion_r2087215148


##########
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonControllerJob.java:
##########
@@ -121,10 +123,9 @@ public int run(String[] args) throws IOException, 
InterruptedException, ClassNot
     if (amMemoryMB != null && !amMemoryMB.isEmpty()) {
       conf.set(AppConfig.HADOOP_MR_AM_MEMORY_MB, amMemoryMB);
     }
-    String amJavaOpts = appConf.controllerAMChildOpts();
-    if (amJavaOpts != null && !amJavaOpts.isEmpty()) {
-      conf.set(AppConfig.HADOOP_MR_AM_JAVA_OPTS, amJavaOpts);
-    }
+    String amJavaOpts = 
StringUtils.defaultString(appConf.controllerAMChildOpts());
+    amJavaOpts = String.join(" ", amJavaOpts, 
JavaVersionUtils.getAddOpensFlagsIfNeeded()).trim();

Review Comment:
   
[this](https://github.com/apache/hive/blob/03d8f4d4b2791fc1fa49c2b2969996458c194577/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java#L726-L729)
 didn't handle spaces either.
   Why not simply use 
   ````
   String amJavaOpts = 
StringUtils.defaultString(appConf.controllerAMChildOpts());
   amJavaOpts += JavaVersionUtils.getAddOpensFlagsIfNeeded()
   ````
   add-opens, if required,  should start with a space
   ````
   return String.join(" ",
             " -XX:IgnoreUnrecognizedVMOptions",
   ````
   
   in my opinion it's much more readable than current impl 



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to