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 2023/01/09 09:54:54 UTC

[GitHub] [incubator-seatunnel] Hisoka-X commented on a diff in pull request #3798: [Feature][Core][Starter] Refactor starter module

Hisoka-X commented on code in PR #3798:
URL: https://github.com/apache/incubator-seatunnel/pull/3798#discussion_r1064421152


##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/utils/FileUtils.java:
##########
@@ -42,12 +43,12 @@ private FileUtils() {
      * @param args args
      * @return path of the seatunnel config file.
      */
-    public static Path getConfigPath(AbstractCommandArgs args) {
-        checkNotNull(args, "args");
-        checkNotNull(args.getDeployMode(), "deploy mode");
+    public static Path getConfigPath(@NonNull AbstractCommandArgs args) {
         switch (args.getDeployMode()) {
+            case RUN:

Review Comment:
   Same as above



##########
seatunnel-common/src/main/java/org/apache/seatunnel/common/config/DeployMode.java:
##########
@@ -17,34 +17,39 @@
 
 package org.apache.seatunnel.common.config;
 
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
 import java.util.Arrays;
 import java.util.Map;
 import java.util.Optional;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
-@Getter
-@AllArgsConstructor
 public enum DeployMode {
+    /**

Review Comment:
   Add Engine DepolyMode To Common, give me a feeling that there is no uniform parameter



##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/utils/ConfigBuilder.java:
##########
@@ -15,57 +15,44 @@
  * limitations under the License.
  */
 
-package org.apache.seatunnel.core.starter.config;
-
-import org.apache.seatunnel.common.config.ConfigRuntimeException;
+package org.apache.seatunnel.core.starter.utils;
 
 import org.apache.seatunnel.shade.com.typesafe.config.Config;
 import org.apache.seatunnel.shade.com.typesafe.config.ConfigFactory;
 import org.apache.seatunnel.shade.com.typesafe.config.ConfigRenderOptions;
 import org.apache.seatunnel.shade.com.typesafe.config.ConfigResolveOptions;
 
+import lombok.NonNull;
 import lombok.extern.slf4j.Slf4j;
 
 import java.nio.file.Path;
+import java.nio.file.Paths;
 
 /**
- * Used to build the {@link  Config} from file.
+ * Used to build the {@link Config} from config file.
  */
 @Slf4j
 public class ConfigBuilder {
 
-    private static final String PLUGIN_NAME_KEY = "plugin_name";
-    private final Path configFile;
-    private final Config config;
+    private static final ConfigRenderOptions CONFIG_RENDER_OPTIONS = ConfigRenderOptions.concise().setFormatted(true);
 
-    public ConfigBuilder(Path configFile) {
-        this.configFile = configFile;
-        this.config = load();
+    public ConfigBuilder() {

Review Comment:
   ```suggestion
       private ConfigBuilder() {
   ```



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