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/01/20 11:53:36 UTC

[GitHub] [incubator-seatunnel] simon824 opened a new pull request #1117: [SeaTunnel #1116] Optimize CheckConfigUtil and add UT

simon824 opened a new pull request #1117:
URL: https://github.com/apache/incubator-seatunnel/pull/1117


   
   ## Purpose of this pull request
   
   closes #1116
   Optimize CheckConfigUtil and add UT
   ## Check list
   
   * [ ] Code changed are covered with tests, or it does not need tests for reason:
   * [ ] If any new Jar binary package adding in you PR, please add License Notice according
     [New License Guide](https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/developement/NewLicenseGuide.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-seatunnel/tree/dev/docs
   


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



[GitHub] [incubator-seatunnel] yx91490 commented on a change in pull request #1117: [SeaTunnel #1116] Optimize CheckConfigUtil and add UT

Posted by GitBox <gi...@apache.org>.
yx91490 commented on a change in pull request #1117:
URL: https://github.com/apache/incubator-seatunnel/pull/1117#discussion_r788719144



##########
File path: seatunnel-common/src/main/java/org/apache/seatunnel/common/config/CheckConfigUtil.java
##########
@@ -26,17 +26,14 @@
 
 public class CheckConfigUtil {
 
-    public static CheckResult check(Config config, String... params) {
-        StringBuilder missingParams = new StringBuilder();
-        for (String param : params) {
-            if (!config.hasPath(param) || config.getAnyRef(param) == null) {
-                missingParams.append(param).append(",");
-            }
-        }
+    public static CheckResult checkAllExists(Config config, String... params) {

Review comment:
       1. since it's in common module, should we keep `check()` method and add an `@Deprecated` annotation to keep API compatible?
   2. the new method named `requireAllExist` be better.




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



[GitHub] [incubator-seatunnel] yx91490 commented on a change in pull request #1117: [SeaTunnel #1116] Optimize CheckConfigUtil and add UT

Posted by GitBox <gi...@apache.org>.
yx91490 commented on a change in pull request #1117:
URL: https://github.com/apache/incubator-seatunnel/pull/1117#discussion_r788719144



##########
File path: seatunnel-common/src/main/java/org/apache/seatunnel/common/config/CheckConfigUtil.java
##########
@@ -26,17 +26,14 @@
 
 public class CheckConfigUtil {
 
-    public static CheckResult check(Config config, String... params) {
-        StringBuilder missingParams = new StringBuilder();
-        for (String param : params) {
-            if (!config.hasPath(param) || config.getAnyRef(param) == null) {
-                missingParams.append(param).append(",");
-            }
-        }
+    public static CheckResult checkAllExists(Config config, String... params) {

Review comment:
       since it's in common module, should we keep the `check()` method and add an `@Deprecated` annotation to keep API compatible?




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



[GitHub] [incubator-seatunnel] yx91490 commented on a change in pull request #1117: [SeaTunnel #1116] Optimize CheckConfigUtil and add UT

Posted by GitBox <gi...@apache.org>.
yx91490 commented on a change in pull request #1117:
URL: https://github.com/apache/incubator-seatunnel/pull/1117#discussion_r788719144



##########
File path: seatunnel-common/src/main/java/org/apache/seatunnel/common/config/CheckConfigUtil.java
##########
@@ -26,17 +26,14 @@
 
 public class CheckConfigUtil {
 
-    public static CheckResult check(Config config, String... params) {
-        StringBuilder missingParams = new StringBuilder();
-        for (String param : params) {
-            if (!config.hasPath(param) || config.getAnyRef(param) == null) {
-                missingParams.append(param).append(",");
-            }
-        }
+    public static CheckResult checkAllExists(Config config, String... params) {

Review comment:
       since it's in common module, should we keep `check()` method and add an `@Deprecated` annotation to keep API compatible?




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



[GitHub] [incubator-seatunnel] simon824 commented on a change in pull request #1117: [SeaTunnel #1116] Optimize CheckConfigUtil and add UT

Posted by GitBox <gi...@apache.org>.
simon824 commented on a change in pull request #1117:
URL: https://github.com/apache/incubator-seatunnel/pull/1117#discussion_r789270021



##########
File path: seatunnel-common/src/main/java/org/apache/seatunnel/common/config/CheckConfigUtil.java
##########
@@ -26,17 +26,14 @@
 
 public class CheckConfigUtil {
 
-    public static CheckResult check(Config config, String... params) {
-        StringBuilder missingParams = new StringBuilder();
-        for (String param : params) {
-            if (!config.hasPath(param) || config.getAnyRef(param) == null) {
-                missingParams.append(param).append(",");
-            }
-        }
+    public static CheckResult checkAllExists(Config config, String... params) {

Review comment:
       make sense, thanks.




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



[GitHub] [incubator-seatunnel] RickyHuo commented on a change in pull request #1117: [SeaTunnel #1116] Optimize CheckConfigUtil and add UT

Posted by GitBox <gi...@apache.org>.
RickyHuo commented on a change in pull request #1117:
URL: https://github.com/apache/incubator-seatunnel/pull/1117#discussion_r788765835



##########
File path: seatunnel-common/src/main/java/org/apache/seatunnel/common/config/CheckConfigUtil.java
##########
@@ -26,17 +26,14 @@
 
 public class CheckConfigUtil {
 
-    public static CheckResult check(Config config, String... params) {
-        StringBuilder missingParams = new StringBuilder();
-        for (String param : params) {
-            if (!config.hasPath(param) || config.getAnyRef(param) == null) {
-                missingParams.append(param).append(",");
-            }
-        }
+    public static CheckResult checkAllExists(Config config, String... params) {

Review comment:
       +1




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



[GitHub] [incubator-seatunnel] RickyHuo merged pull request #1117: [SeaTunnel #1116] Optimize CheckConfigUtil and add UT

Posted by GitBox <gi...@apache.org>.
RickyHuo merged pull request #1117:
URL: https://github.com/apache/incubator-seatunnel/pull/1117


   


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