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/21 02:30:00 UTC

[GitHub] [incubator-seatunnel] ashulin opened a new pull request, #2041: [api-draft][connector] Add simplified connector api

ashulin opened a new pull request, #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041

   <!--
   
   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 "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   
   -->
   
   ## Purpose of this pull request
   Add simplified connector api
   
   <!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
   
   ## Check list
   
   * [ ] Code changed are covered with tests, or it does not need tests for reason:
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/contribution/new-license.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] lhyundeadsoul commented on a diff in pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
lhyundeadsoul commented on code in PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#discussion_r912962254


##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/source/SeaTunnelRuntimeEnvironment.java:
##########
@@ -24,12 +24,7 @@
  */
 public interface SeaTunnelRuntimeEnvironment {

Review Comment:
   `xxxAware` is a better class name when there is only one` setXXX `method.
   Refer to` spring framewok` `org.springframework.web.context.ServletConfigAware ``org.springframework.context.ApplicationContextAware`



-- 
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] lhyundeadsoul commented on pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
lhyundeadsoul commented on PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#issuecomment-1173760646

   Why doesn't `org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext` should extend `SourceReader.Context` rather than composition? @ashulin 


-- 
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] ashulin commented on a diff in pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
ashulin commented on code in PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#discussion_r914354678


##########
seatunnel-connectors/seatunnel-connectors-seatunnel/seatunnel-connector-seatunnel-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/source/SingleSplitReaderContext.java:
##########
@@ -15,23 +15,23 @@
  * limitations under the License.
  */
 
-package org.apache.seatunnel.connectors.seatunnel.fake.source;
+package org.apache.seatunnel.connectors.seatunnel.common.source;
 
-import org.apache.seatunnel.api.source.SourceSplit;
+import org.apache.seatunnel.api.source.Boundedness;
+import org.apache.seatunnel.api.source.SourceReader;
 
-public class FakeSourceSplit implements SourceSplit {
+public class SingleSplitReaderContext {

Review Comment:
   Using composition prevents developers from using the `SourceReader.Context#sendSplitRequest` and `SourceReader.Context#sendSourceEventToCoordinator` methods. If we use `implements`, we need to throw exceptions in this methods.



-- 
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] Hisoka-X commented on pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
Hisoka-X commented on PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#issuecomment-1166156450

   Hi, please resolve conflict


-- 
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] ashulin commented on a diff in pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
ashulin commented on code in PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#discussion_r914694897


##########
seatunnel-connectors/seatunnel-connectors-seatunnel/seatunnel-connector-seatunnel-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/source/SingleSplitReaderContext.java:
##########
@@ -15,23 +15,23 @@
  * limitations under the License.
  */
 
-package org.apache.seatunnel.connectors.seatunnel.fake.source;
+package org.apache.seatunnel.connectors.seatunnel.common.source;
 
-import org.apache.seatunnel.api.source.SourceSplit;
+import org.apache.seatunnel.api.source.Boundedness;
+import org.apache.seatunnel.api.source.SourceReader;
 
-public class FakeSourceSplit implements SourceSplit {
+public class SingleSplitReaderContext {

Review Comment:
   `ParallelReaderContext` belongs to the *translation* module, and the *translation* module can define how to translate the api to the source of the engine (that is, how the reader and the enumerator interact is determined by the engine, etc.);
   The `SingleSplitReaderContext` belongs to the *connector* module, and it cannot define how the `Context` actually works.



-- 
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] lhyundeadsoul commented on a diff in pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
lhyundeadsoul commented on code in PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#discussion_r914367824


##########
seatunnel-connectors/seatunnel-connectors-seatunnel/seatunnel-connector-seatunnel-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/source/SingleSplitReaderContext.java:
##########
@@ -15,23 +15,23 @@
  * limitations under the License.
  */
 
-package org.apache.seatunnel.connectors.seatunnel.fake.source;
+package org.apache.seatunnel.connectors.seatunnel.common.source;
 
-import org.apache.seatunnel.api.source.SourceSplit;
+import org.apache.seatunnel.api.source.Boundedness;
+import org.apache.seatunnel.api.source.SourceReader;
 
-public class FakeSourceSplit implements SourceSplit {
+public class SingleSplitReaderContext {

Review Comment:
   It's a little unintelligible that `SingleSplitReaderContext` is **NOT** a subclass of `SourceReader.Context` , How about  following alternatives:
   1.  `SingleSplitReaderContext` implements `SourceReader.Context`, and remove `sendSplitRequest ` `sendSourceEventToCoordinator ` from `SourceReader.Context` if possible. I think these method may not belong Context Object.
   2. Use implements, and throw exceptions. That also makes sense.



-- 
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] lhyundeadsoul commented on a diff in pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
lhyundeadsoul commented on code in PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#discussion_r914366060


##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/source/SeaTunnelRuntimeEnvironment.java:
##########
@@ -24,12 +24,7 @@
  */
 public interface SeaTunnelRuntimeEnvironment {

Review Comment:
   No problem



-- 
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] lhyundeadsoul commented on a diff in pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
lhyundeadsoul commented on code in PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#discussion_r914592731


##########
seatunnel-connectors/seatunnel-connectors-seatunnel/seatunnel-connector-seatunnel-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/source/SingleSplitReaderContext.java:
##########
@@ -15,23 +15,23 @@
  * limitations under the License.
  */
 
-package org.apache.seatunnel.connectors.seatunnel.fake.source;
+package org.apache.seatunnel.connectors.seatunnel.common.source;
 
-import org.apache.seatunnel.api.source.SourceSplit;
+import org.apache.seatunnel.api.source.Boundedness;
+import org.apache.seatunnel.api.source.SourceReader;
 
-public class FakeSourceSplit implements SourceSplit {
+public class SingleSplitReaderContext {

Review Comment:
   Sorry, I still don't understand why `ParallelReaderContext` can implement `SourceReader.Context` but `SingleSplitReaderContext` can not?
   



-- 
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] ashulin commented on a diff in pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
ashulin commented on code in PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#discussion_r914694897


##########
seatunnel-connectors/seatunnel-connectors-seatunnel/seatunnel-connector-seatunnel-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/source/SingleSplitReaderContext.java:
##########
@@ -15,23 +15,23 @@
  * limitations under the License.
  */
 
-package org.apache.seatunnel.connectors.seatunnel.fake.source;
+package org.apache.seatunnel.connectors.seatunnel.common.source;
 
-import org.apache.seatunnel.api.source.SourceSplit;
+import org.apache.seatunnel.api.source.Boundedness;
+import org.apache.seatunnel.api.source.SourceReader;
 
-public class FakeSourceSplit implements SourceSplit {
+public class SingleSplitReaderContext {

Review Comment:
   `ParallelReaderContext` belongs to the *translation* module, and the *translation* module can define how to translate the api to the source of the engine (that is, how the reader and the enumerator interact is determined by the engine, etc.);
   `SingleSplitReaderContext` belongs to the *connector* module, and it cannot define how the `Context` actually works.



-- 
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] lhyundeadsoul commented on a diff in pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
lhyundeadsoul commented on code in PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#discussion_r915006167


##########
seatunnel-connectors/seatunnel-connectors-seatunnel/seatunnel-connector-seatunnel-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/source/SingleSplitReaderContext.java:
##########
@@ -15,23 +15,23 @@
  * limitations under the License.
  */
 
-package org.apache.seatunnel.connectors.seatunnel.fake.source;
+package org.apache.seatunnel.connectors.seatunnel.common.source;
 
-import org.apache.seatunnel.api.source.SourceSplit;
+import org.apache.seatunnel.api.source.Boundedness;
+import org.apache.seatunnel.api.source.SourceReader;
 
-public class FakeSourceSplit implements SourceSplit {
+public class SingleSplitReaderContext {

Review Comment:
   > `ParallelReaderContext` belongs to the *translation* module, and the *translation* module can define how to translate the api to the source of the engine (that is, how the reader and the enumerator interact is determined by the engine, etc.);
   > 
   > `SingleSplitReaderContext` belongs to the *connector* module, and it cannot define how the `Context` actually works.
   
   Thx for your explanation. I can better understand translation module 



-- 
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] lhyundeadsoul commented on a diff in pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
lhyundeadsoul commented on code in PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#discussion_r912950907


##########
seatunnel-connectors/seatunnel-connectors-seatunnel/seatunnel-connector-seatunnel-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/source/SingleSplitReaderContext.java:
##########
@@ -15,23 +15,23 @@
  * limitations under the License.
  */
 
-package org.apache.seatunnel.connectors.seatunnel.fake.source;
+package org.apache.seatunnel.connectors.seatunnel.common.source;
 
-import org.apache.seatunnel.api.source.SourceSplit;
+import org.apache.seatunnel.api.source.Boundedness;
+import org.apache.seatunnel.api.source.SourceReader;
 
-public class FakeSourceSplit implements SourceSplit {
+public class SingleSplitReaderContext {

Review Comment:
   Why doesn't `org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext` extend `SourceReader.Context` rather than composition?



-- 
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] Hisoka-X merged pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
Hisoka-X merged PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041


-- 
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] ashulin commented on a diff in pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
ashulin commented on code in PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#discussion_r914358679


##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/source/SeaTunnelRuntimeEnvironment.java:
##########
@@ -24,12 +24,7 @@
  */
 public interface SeaTunnelRuntimeEnvironment {

Review Comment:
   This's good idea! Can you contribute to it?



-- 
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] ashulin commented on a diff in pull request #2041: [api-draft][connector] Add simplified connector api

Posted by GitBox <gi...@apache.org>.
ashulin commented on code in PR #2041:
URL: https://github.com/apache/incubator-seatunnel/pull/2041#discussion_r914393997


##########
seatunnel-connectors/seatunnel-connectors-seatunnel/seatunnel-connector-seatunnel-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/source/SingleSplitReaderContext.java:
##########
@@ -15,23 +15,23 @@
  * limitations under the License.
  */
 
-package org.apache.seatunnel.connectors.seatunnel.fake.source;
+package org.apache.seatunnel.connectors.seatunnel.common.source;
 
-import org.apache.seatunnel.api.source.SourceSplit;
+import org.apache.seatunnel.api.source.Boundedness;
+import org.apache.seatunnel.api.source.SourceReader;
 
-public class FakeSourceSplit implements SourceSplit {
+public class SingleSplitReaderContext {

Review Comment:
   The instantiation of `SourceReader.Context` is hidden, so although SingleSplitReaderContext can `implements SourceReader.Context`, it must be combined with the internal `SourceReader.Context`.



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