You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/04/26 14:06:18 UTC

[GitHub] [incubator-seatunnel] whb-bigdata commented on a diff in pull request #1747: [Bug][seatunnel-core-spark] spark on yarn cluster mode can not get --config/-c file

whb-bigdata commented on code in PR #1747:
URL: https://github.com/apache/incubator-seatunnel/pull/1747#discussion_r858758266


##########
seatunnel-core/seatunnel-core-spark/src/main/java/org/apache/seatunnel/SparkStarter.java:
##########
@@ -293,6 +296,24 @@ protected void appendAppJar(List<String> commands) {
         commands.add(Common.appLibDir().resolve("seatunnel-core-spark.jar").toString());
     }
 
+    /**
+     * change file location to get config file on yarn cluster mode
+     */
+    protected void changeFileLocation() {
+        if (DeployMode.CLUSTER.getName().equals(this.commandArgs.getDeployMode().getName())) {
+            String regEx = ".+/(.+)$";
+            Pattern p = Pattern.compile(regEx);
+            for (int i = 1; i < args.length; i++) {
+                if ("-c".equals(args[i - 1]) || "--config".equals(args[i - 1])) {
+                    Matcher m = p.matcher(args[i]);
+                    if (m.find()) {
+                        args[i] = m.group(1);

Review Comment:
   Thank you for your reply .The new version adds the parameters to the back but does not get the file name. Based on this, it can be modified by changing the parameters. Do you have any better suggestions? 



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org