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/22 14:50:18 UTC

[GitHub] [incubator-seatunnel] asdf2014 opened a new pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

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


   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-seatunnel/issues).
   
     - Name the pull request in the form "[SeaTunnel #XXXX] [component] Title of the pull request", where *SeaTunnel #XXXX* should be replaced by the actual issue number.
   
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   
   -->
   
   ## Purpose of this pull request
   
   <!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
   
   We should add `@Nullable` annotation to `BaseFlinkSink` apis to remind returns of them could be `null`.
   
   ## Check list
   
   * [x] Code changed are covered with tests, or it does not need tests for reason:
   * [x] 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)
   * [x] 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] asdf2014 commented on a change in pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

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



##########
File path: seatunnel-connectors/seatunnel-connector-flink-doris/src/main/java/org/apache/seatunnel/flink/sink/DorisSink.java
##########
@@ -34,6 +34,7 @@
 import org.apache.flink.types.Row;
 import org.apache.flink.util.Preconditions;
 
+import javax.annotation.Nullable;

Review comment:
       Hi @SteNicholas , I believe it’s not big deal, also you are welcome to create a PR to add a rule into code style if you are free




-- 
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] CalvinKirs commented on pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on pull request #1139:
URL: https://github.com/apache/incubator-seatunnel/pull/1139#issuecomment-1031094584


   @asdf2014 hi, can you resolve conflicts files?


-- 
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] SteNicholas commented on pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on pull request #1139:
URL: https://github.com/apache/incubator-seatunnel/pull/1139#issuecomment-1019636078


   @asdf2014 , could the `@Nullable` annotation follow the checkstyle of Flink: https://flink.apache.org/contributing/code-style-and-quality-java.html
   - Use @Nullable annotation where you do not use Optional for the nullable values.
   - If you can prove that Optional usage would lead to a performance degradation in critical code then fallback to @Nullable.
   - Always use Optional to return nullable values in the API/public methods except the case of a proven performance concern.
   - Do not use Optional as a function argument, instead either overload the method or use the Builder pattern for the set of function arguments.
   Note: an Optional argument can be allowed in a private helper method if you believe that it simplifies the code (example).
   - Do not use Optional for class fields.


-- 
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] CalvinKirs merged pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

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


   


-- 
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] SteNicholas commented on a change in pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

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



##########
File path: seatunnel-connectors/seatunnel-connector-flink-kafka/src/main/java/org/apache/seatunnel/flink/sink/KafkaTable.java
##########
@@ -38,6 +38,8 @@
 import org.apache.flink.table.descriptors.Schema;
 import org.apache.flink.types.Row;
 
+import javax.annotation.Nullable;
+
 import java.util.Properties;

Review comment:
       Does the checkstyle rules for `javax` work?




-- 
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] SteNicholas commented on pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on pull request #1139:
URL: https://github.com/apache/incubator-seatunnel/pull/1139#issuecomment-1023782335


   @asdf2014, it's recommended to add them as rules into check style plugin. I'm willing to raise up some follow-up PRs to implement them.


-- 
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] asdf2014 closed pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

Posted by GitBox <gi...@apache.org>.
asdf2014 closed pull request #1139:
URL: https://github.com/apache/incubator-seatunnel/pull/1139


   


-- 
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] asdf2014 commented on a change in pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

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



##########
File path: seatunnel-connectors/seatunnel-connector-flink-doris/src/main/java/org/apache/seatunnel/flink/sink/DorisSink.java
##########
@@ -34,6 +34,7 @@
 import org.apache.flink.types.Row;
 import org.apache.flink.util.Preconditions;
 
+import javax.annotation.Nullable;

Review comment:
       Hi @SteNicholas, thanks for you comment, I agree with you, and I just create a PR to add a rule into Code Style for the order of improts to further ensure uniformity of code style across each connector.




-- 
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] asdf2014 commented on pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

Posted by GitBox <gi...@apache.org>.
asdf2014 commented on pull request #1139:
URL: https://github.com/apache/incubator-seatunnel/pull/1139#issuecomment-1023217267


   Hi @SteNicholas, thanks for your comment. This is great, it would be better to add them as rules into check style plugin, right? Would you willing to raise up some follow-up PRs to implement them


-- 
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] asdf2014 commented on a change in pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

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



##########
File path: seatunnel-connectors/seatunnel-connector-flink-doris/src/main/java/org/apache/seatunnel/flink/sink/DorisSink.java
##########
@@ -34,6 +34,7 @@
 import org.apache.flink.types.Row;
 import org.apache.flink.util.Preconditions;
 
+import javax.annotation.Nullable;

Review comment:
       Hi @SteNicholas , I believe it’s not big deal, also you are welcome to create a PR to add a rule into code style if you are free




-- 
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] SteNicholas commented on a change in pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

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



##########
File path: seatunnel-connectors/seatunnel-connector-flink-doris/src/main/java/org/apache/seatunnel/flink/sink/DorisSink.java
##########
@@ -34,6 +34,7 @@
 import org.apache.flink.types.Row;
 import org.apache.flink.util.Preconditions;
 
+import javax.annotation.Nullable;

Review comment:
       Does the `javax` package class import after the `java`?




-- 
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] asdf2014 commented on a change in pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

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



##########
File path: seatunnel-connectors/seatunnel-connector-flink-kafka/src/main/java/org/apache/seatunnel/flink/sink/KafkaTable.java
##########
@@ -38,6 +38,8 @@
 import org.apache.flink.table.descriptors.Schema;
 import org.apache.flink.types.Row;
 
+import javax.annotation.Nullable;
+
 import java.util.Properties;

Review comment:
       Yes, it does




-- 
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] CalvinKirs commented on pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on pull request #1139:
URL: https://github.com/apache/incubator-seatunnel/pull/1139#issuecomment-1031094420


   > LGTM. @CalvinKirs could you review this pull request?
   
   Sorry for taking so long to reply, thanks for your review, I think good


-- 
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] asdf2014 commented on pull request #1139: [Improve] Add @Nullable annotation to BaseFlinkSink apis

Posted by GitBox <gi...@apache.org>.
asdf2014 commented on pull request #1139:
URL: https://github.com/apache/incubator-seatunnel/pull/1139#issuecomment-1031095276


   Hi @CalvinKirs, thanks for your comment, the conflicts have been resolved


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