You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2020/04/07 09:57:47 UTC

[GitHub] [incubator-hudi] hddong commented on a change in pull request #1452: [HUDI-740]Fix can not specify the sparkMaster of cleans run command

hddong commented on a change in pull request #1452: [HUDI-740]Fix can not specify the sparkMaster of cleans run command
URL: https://github.com/apache/incubator-hudi/pull/1452#discussion_r404685892
 
 

 ##########
 File path: hudi-cli/src/main/java/org/apache/hudi/cli/utils/SparkUtil.java
 ##########
 @@ -61,9 +62,14 @@ public static SparkLauncher initLauncher(String propertiesFile) throws URISyntax
   }
 
   public static JavaSparkContext initJavaSparkConf(String name) {
+    return initJavaSparkConf(name, Option.empty(), Option.empty());
+  }
+
+  public static JavaSparkContext initJavaSparkConf(String name, Option<String> master,
+                                                   Option<String> executorMemory) {
     SparkConf sparkConf = new SparkConf().setAppName(name);
 
-    String defMasterFromEnv = sparkConf.getenv("SPARK_MASTER");
+    String defMasterFromEnv = master.orElse(sparkConf.getenv("SPARK_MASTER"));
 
 Review comment:
   > Can we extract the string literals in this method to be constant fields?
   
   @yanghua There is constant fields `DEFAULT_SPARK_MASTER` for master.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services