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/06/07 07:47:01 UTC

[GitHub] [incubator-seatunnel] zhuangchong commented on a diff in pull request #1991: [api-draft#1990][Common] The DeployMode code cleanup

zhuangchong commented on code in PR #1991:
URL: https://github.com/apache/incubator-seatunnel/pull/1991#discussion_r890875722


##########
seatunnel-common/src/main/java/org/apache/seatunnel/common/config/Common.java:
##########
@@ -70,19 +54,17 @@ public static Optional<String> getDeployMode() {
      * When running seatunnel in --master yarn or --master mesos, you can put plugins related files in plugins dir.
      */
     public static Path appRootDir() {
-        if (MODE.equals(Optional.of(DeployMode.CLIENT.getName()))) {
+        if (DeployMode.CLIENT == MODE) {
             try {
                 String path = Common.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
                 path = new File(path).getPath();
                 return Paths.get(path).getParent().getParent();
             } catch (URISyntaxException e) {
                 throw new RuntimeException(e);
             }
-        } else if (MODE.equals(Optional.of(DeployMode.CLUSTER.getName()))) {
-            return Paths.get("");
-        } else {
-            throw new IllegalStateException("MODE not support : " + MODE.orElse("null"));
         }
+        // deploy mode: cluster

Review Comment:
   done.



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