This is an automated email from the ASF dual-hosted git repository.
gaojun2048 pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new 9659430fa [Feature][Doc] Improved connectors v2 contribution guide
(#3218)
9659430fa is described below
commit 9659430fa2e6b1b19fc04aa864cd1daa5e0667a3
Author: 旭日东升 <[email protected]>
AuthorDate: Tue Nov 8 18:41:50 2022 +0800
[Feature][Doc] Improved connectors v2 contribution guide (#3218)
---
seatunnel-connectors-v2/README.md | 33 ++++++++++++++++++++++++++++++---
seatunnel-connectors-v2/README.zh.md | 29 ++++++++++++++++++++++++++++-
2 files changed, 58 insertions(+), 4 deletions(-)
diff --git a/seatunnel-connectors-v2/README.md
b/seatunnel-connectors-v2/README.md
index e6a6c6006..61aad40f8 100644
--- a/seatunnel-connectors-v2/README.md
+++ b/seatunnel-connectors-v2/README.md
@@ -10,6 +10,15 @@ this
[issue](https://github.com/apache/incubator-seatunnel/issues/1608) for deta
In order to separate from the old code, we have defined new modules for
execution flow. This facilitates parallel
development at the current stage, and reduces the difficulty of merging.
+### engineering structure
+
+- ../`seatunnel-connectors-v2`
connector-v2 code implementation
+- ../`seatunnel-translation`
translation layer for the connector-v2
+- ../seatunnel-e2e/`seatunnel-flink-connector-v2-e2e` end to
end testcase running on flink
+- ../seatunnel-e2e/`seatunnel-spark-connector-v2-e2e` end to
end testcase running on spark
+- ../seatunnel-examples/`seatunnel-flink-connector-v2-example`
seatunnel connector-v2 example use flink local running instance
+- ../seatunnel-examples/`seatunnel-spark-connector-v2-example`
seatunnel connector-v2 example use spark local running instance
+
### **Example**
We have prepared two new version of the locally executable example program in
`seatunnel-examples`,one
@@ -22,13 +31,31 @@ configuration files used in example are saved in the
"resources/examples" folder
own connectors, you need to follow the steps below.
1. Add the groupId, artifactId and version of the connector to be tested to
- seatunnel-examples/seatunnel-flink-connector-v2-example/pom.xml(or add it to
- seatunnel-examples/seatunnel-spark-connector-v2-example/pom.xml when you
want to runs it in Spark engine) as a
+ `seatunnel-examples/seatunnel-flink-connector-v2-example/pom.xml`(or add it
to
+ `seatunnel-examples/seatunnel-spark-connector-v2-example/pom.xml` when you
want to runs it in Spark engine) as a
dependency.
2. Find the dependency in your connector pom file which scope is test or
provided and then add them to
seatunnel-examples/seatunnel-flink-connector-v2-example/pom.xml(or add it to
seatunnel-examples/seatunnel-spark-connector-v2-example/pom.xml) file and
modify the scope to compile.
-3. Refer to the SeaTunnelApiExample class to develop your sample code.
+3. Add the task configuration file under resources/examples.
+4. Configure the file in the `SeaTunnelApiExample` main method.
+5. Just run the main method.
+
+### **Create new seatunnel v2 connector**
+
+1.Create a new module under the `seatunnel-connectors-v2` directory and name
it connector - {connector name}.
+
+2.The pom file can refer to the pom file of the existing connector, and add
the current sub model to the pom file of the parent model
+
+3.Create two packages corresponding to source and sink
+
+ package org.apache.seatunnel.connectors.seatunnel.{connector name}}.source
+
+ package org.apache.seatunnel.connectors.seatunnel.{connector name}}.sink
+
+4.add connector info to plugin-mapping.properties file in seatunnel root path.
+
+5.add connector dependency to seatunnel-dist/pom.xml, so the connector jar can
be find in binary package.
### **Startup Class**
diff --git a/seatunnel-connectors-v2/README.zh.md
b/seatunnel-connectors-v2/README.zh.md
index 02a59af2e..4efbc6d59 100644
--- a/seatunnel-connectors-v2/README.zh.md
+++ b/seatunnel-connectors-v2/README.zh.md
@@ -7,6 +7,15 @@ SeaTunnel为与计算引擎进行解耦,设计了新的连接器API,通过
为了和老的代码分开,方便现阶段的并行开发,以及降低merge的难度。我们为新的执行流程定义了新的模块
+### **工程结构**
+
+- ../`seatunnel-connectors-v2`
connector-v2代码实现
+- ../`seatunnel-translation`
connector-v2的翻译层
+- ../seatunnel-e2e/`seatunnel-flink-connector-v2-e2e`
flink上运行的端到端testcase
+- ../seatunnel-e2e/`seatunnel-spark-connector-v2-e2e`
spark上运行的端到端testcase
+- ../seatunnel-examples/`seatunnel-flink-connector-v2-example`
seatunnel connector-v2的flink local运行的实例
+- ../seatunnel-examples/`seatunnel-spark-connector-v2-example`
seatunnel connector-v2的spark local运行的实例
+
### Example
我们已经在`seatunnel-examples`
@@ -18,7 +27,25 @@ SeaTunnel为与计算引擎进行解耦,设计了新的连接器API,通过
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(
或者在seatunnel-examples/seatunnel-spark-connector-v2-example/pom.xml)中,并且修改scope为compile.
-3. 参考`SeaTunnelApiExample`开发自己的案例程序。
+3. 在resources/examples下添加任务配置文件.
+4. 在`SeaTunnelApiExample` main方法中配置文件.
+5. 运行main方法即可.
+
+### 创建新的seatunnel v2 connector
+
+1.在`seatunnel-connectors-v2`目录下新建一个module,命名为connector-{连接器名}.
+
+2.pom文件可以参考已有连接器的pom文件,并在父model的pom文件中添加当前子model.
+
+3.新建两个package分别对应source和sink
+
+ package org.apache.seatunnel.connectors.seatunnel.{连接器名}.source
+
+ package org.apache.seatunnel.connectors.seatunnel.{连接器名}.sink
+
+4.将连接器信息添加到在项目根目录的plugin-mapping.properties文件中.
+
+5.将连接器添加到seatunnel-dist/pom.xml,这样连接器jar就可以在二进制包中找到.
### 启动类