EricJoy2048 commented on code in PR #2800: URL: https://github.com/apache/incubator-seatunnel/pull/2800#discussion_r979538093
########## seatunnel-connectors-v2/README.zh.md: ########## @@ -1,64 +1,127 @@ ## 目的 -Because SeaTunnel design new API for connectors, 所以通过这篇文章来介绍新的接口以及新的代码结构,方便开发者快速的帮助新API和翻译层完善,以及开发出新的Connecotor. + +SeaTunnel为与计算引擎进行解耦,设计了新的连接器API,通过这篇文章来介绍新的接口以及新的代码结构,方便开发者快速上手使用新版API开发连接器并理解新版API运行原理. +详细设计请查看该[提议](https://github.com/apache/incubator-seatunnel/issues/1608) 。 + ## 代码结构 -现阶段所有相关代码保存在`api-draft`分支上。 + 为了和老的代码分开,方便现阶段的并行开发,以及降低merge的难度。我们为新的执行流程定义了新的模块 + ### Example -我们已经在`seatunnel-examples`中准备好了新版本的可本地执行Example程序,直接调用`seatunnel-flink-connector-v2-example`或`seatunnel-spark-connector-v2-example`中的`SeaTunnelApiExample`即可。这也是本地开发Connector经常会用到的调试方式。 -对应的配置文件保存在同模块的`resources/examples`文件夹下,和以前一样。 + +我们已经在`seatunnel-examples` +准备了两个本地可执行的案例程序,其中一个是`seatunnel-examples/seatunnel-flink-connector-v2-example/src/main/java/org/apache/seatunnel/example/flink/v2/SeaTunnelApiExample.java` +,它运行在flink引擎上。另外一个是`seatunnel-examples/seatunnel-spark-connector-v2-example/src/main/java/org/apache/seatunnel/example/spark/v2/SeaTunnelApiExample.java` +,它运行在spark引擎上。你可以通过调试这些例子帮你更好的理解程序运行逻辑。使用的配置文件保存在`resources/examples`文件夹里。如果你想增加自己的connectors,你需要按照下面的步骤。 + +1. 在`seatunnel-examples/seatunnel-flink-connector-v2-example/pom.xml`添加connector依赖的groupId, artifactId 和 + version.(或者当你想在spark引擎运行时在`seatunnel-examples/seatunnel-spark-connector-v2-example/pom.xml`添加依赖) +2. 如果你的connector存在scope为test或者provided的依赖则在`seatunnel-examples/seatunnel-flink-connector-v2-example/pom.xml`( Review Comment: > 如果你的connector存在scope为test或者provided的依赖则在`seatunnel-examples/seatunnel-flink-connector-v2-example/pom.xml`( 或者在`seatunnel-examples/seatunnel-spark-connector-v2-example/pom.xml`)修改为compile。 如果你的connector中存在scope为test或provided的依赖,将这些依赖添加到`seatunnel-examples/seatunnel-flink-connector-v2-example/pom.xml`( 或者在`seatunnel-examples/seatunnel-spark-connector-v2-example/pom.xml`)中,并且修改scope为compile. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
