Skip to content

Commit 862e205

Browse files
authored
[Improve][Document] Change deprecated connector name in setup.md (#7366)
1 parent 2769ed5 commit 862e205

File tree

2 files changed

+46
-30
lines changed

2 files changed

+46
-30
lines changed

docs/en/contribution/setup.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,40 +80,48 @@ After all the above things are done, you just finish the environment setup and c
8080
of box. All examples are in module `seatunnel-examples`, you could pick one you are interested in, [Running Or Debugging
8181
It In IDEA](https://www.jetbrains.com/help/idea/run-debug-configuration.html) as you wish.
8282

83-
Here we use `seatunnel-examples/seatunnel-flink-connector-v2-example/src/main/java/org/apache/seatunnel/example/flink/v2/SeaTunnelApiExample.java`
83+
Here we use `seatunnel-examples/seatunnel-engine-examples/src/main/java/org/apache/seatunnel/example/engine/SeaTunnelEngineExample.java`
8484
as an example, when you run it successfully you can see the output as below:
8585

8686
```log
87-
+I[Ricky Huo, 71]
88-
+I[Gary, 12]
89-
+I[Ricky Huo, 93]
90-
...
91-
...
92-
+I[Ricky Huo, 83]
87+
2024-08-10 11:45:32,839 INFO org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand -
88+
***********************************************
89+
Job Statistic Information
90+
***********************************************
91+
Start Time : 2024-08-10 11:45:30
92+
End Time : 2024-08-10 11:45:32
93+
Total Time(s) : 2
94+
Total Read Count : 5
95+
Total Write Count : 5
96+
Total Failed Count : 0
97+
***********************************************
9398
```
9499

95100
## What's More
96101

97102
All our examples use simple source and sink to make it less dependent and easy to run. You can change the example configuration
98103
in `resources/examples`. You can change your configuration as below, if you want to use PostgreSQL as the source and
99104
sink to console.
105+
Please note that when using connectors other than FakeSource and Console, you need to modify the dependencies in the `pom.xml` file of the corresponding submodule of seatunnel-example.
100106

101107
```conf
102108
env {
103109
parallelism = 1
110+
job.mode = "BATCH"
104111
}
105-
106112
source {
107-
JdbcSource {
108-
driver = org.postgresql.Driver
109-
url = "jdbc:postgresql://host:port/database"
110-
username = postgres
111-
query = "select * from test"
112-
}
113+
Jdbc {
114+
driver = org.postgresql.Driver
115+
url = "jdbc:postgresql://host:port/database"
116+
username = postgres
117+
password = "123456"
118+
query = "select * from test"
119+
table_path = "database.test"
120+
}
113121
}
114122
115123
sink {
116-
ConsoleSink {}
124+
Console {}
117125
}
118126
```
119127

docs/zh/contribution/setup.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,39 +75,47 @@ Apache SeaTunnel 使用 `Spotless` 来统一代码风格和格式检查。可以
7575
完成上面所有的工作后,环境搭建已经完成, 可以直接运行我们的示例了。 所有的示例在 `seatunnel-examples` 模块里, 你可以随意选择进行编译和调试,参考 [running or debugging
7676
it in IDEA](https://www.jetbrains.com/help/idea/run-debug-configuration.html)
7777

78-
我们使用 `seatunnel-examples/seatunnel-flink-connector-v2-example/src/main/java/org/apache/seatunnel/example/flink/v2/SeaTunnelApiExample.java`
78+
我们使用 `seatunnel-examples/seatunnel-engine-examples/src/main/java/org/apache/seatunnel/example/engine/SeaTunnelEngineExample.java`
7979
作为示例, 运行成功后的输出如下:
8080

8181
```log
82-
+I[Ricky Huo, 71]
83-
+I[Gary, 12]
84-
+I[Ricky Huo, 93]
85-
...
86-
...
87-
+I[Ricky Huo, 83]
82+
2024-08-10 11:45:32,839 INFO org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand -
83+
***********************************************
84+
Job Statistic Information
85+
***********************************************
86+
Start Time : 2024-08-10 11:45:30
87+
End Time : 2024-08-10 11:45:32
88+
Total Time(s) : 2
89+
Total Read Count : 5
90+
Total Write Count : 5
91+
Total Failed Count : 0
92+
***********************************************
8893
```
8994

9095
## 更多信息
9196

9297
所有的实例都用了简单的 source 和 sink, 这样可以使得运行更独立和更简单。
9398
你可以修改 `resources/examples` 中的示例的配置。 例如下面的配置使用 PostgreSQL 作为源,并且输出到控制台。
99+
请注意引用FakeSource 和 Console 以外的连接器时,需要修改seatunnel-example对应子模块下的`pom.xml`文件中的依赖。
94100

95101
```conf
96102
env {
97103
parallelism = 1
104+
job.mode = "BATCH"
98105
}
99-
100106
source {
101-
JdbcSource {
102-
driver = org.postgresql.Driver
103-
url = "jdbc:postgresql://host:port/database"
104-
username = postgres
105-
query = "select * from test"
106-
}
107+
Jdbc {
108+
driver = org.postgresql.Driver
109+
url = "jdbc:postgresql://host:port/database"
110+
username = postgres
111+
password = "123456"
112+
query = "select * from test"
113+
table_path = "database.test"
114+
}
107115
}
108116
109117
sink {
110-
ConsoleSink {}
118+
Console {}
111119
}
112120
```
113121

0 commit comments

Comments
 (0)