Skip to content

Commit d181d5d

Browse files
authored
Merge fbfeaab into c9066e8
2 parents c9066e8 + fbfeaab commit d181d5d

File tree

21 files changed

+525
-2
lines changed

21 files changed

+525
-2
lines changed

.dlc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@
3535
"retryOn429": true,
3636
"retryCount": 10,
3737
"fallbackRetryDelay": "1000s",
38-
"aliveStatusCodes": [200, 401, 0]
38+
"aliveStatusCodes": [200, 401, 403, 0]
3939
}

docs/configs/docsdev.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,22 @@ export default {
303303
title: 'Azure SQL Database',
304304
link: '/en-us/docs/dev/user_doc/guide/datasource/azure-sql.html',
305305
},
306+
{
307+
title: 'Trino',
308+
link: '/en-us/docs/dev/user_doc/guide/datasource/trino.html',
309+
},
310+
{
311+
title: 'StarRocks',
312+
link: '/en-us/docs/dev/user_doc/guide/datasource/starrocks.html',
313+
},
314+
{
315+
title: 'DAMENG',
316+
link: '/en-us/docs/dev/user_doc/guide/datasource/dameng.html',
317+
},
318+
{
319+
title: 'OceanBase',
320+
link: '/en-us/docs/dev/user_doc/guide/datasource/oceanbase.html',
321+
},
306322
],
307323
},
308324
{
@@ -948,6 +964,30 @@ export default {
948964
title: 'Azure SQL Database',
949965
link: '/zh-cn/docs/dev/user_doc/guide/datasource/azure-sql.html',
950966
},
967+
{
968+
title: 'Redshift',
969+
link: '/zh-cn/docs/dev/user_doc/guide/datasource/redshift.html',
970+
},
971+
{
972+
title: 'Oracle',
973+
link: '/zh-cn/docs/dev/user_doc/guide/datasource/oracle.html',
974+
},
975+
{
976+
title: 'Trino',
977+
link: '/zh-cn/docs/dev/user_doc/guide/datasource/trino.html',
978+
},
979+
{
980+
title: 'StarRocks',
981+
link: '/zh-cn/docs/dev/user_doc/guide/datasource/starrocks.html',
982+
},
983+
{
984+
title: 'DAMENG',
985+
link: '/zh-cn/docs/dev/user_doc/guide/datasource/dameng.html',
986+
},
987+
{
988+
title: 'OceanBase',
989+
link: '/zh-cn/docs/dev/user_doc/guide/datasource/oceanbase.html',
990+
},
951991
],
952992
},
953993
{
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# OceanBase
2+
3+
![oceanbase](../../../../img/new_ui/dev/datasource/oceanbase.png)
4+
5+
## Datasource Parameters
6+
7+
| **Datasource** | **Description** |
8+
|----------------------------|--------------------------------------------------------------|
9+
| Datasource | Select OCEANBASE. |
10+
| Datasource name | Enter the name of the DataSource. |
11+
| Description | Enter a description of the DataSource. |
12+
| IP/Host name | Enter the OceanBase service IP. |
13+
| Port | Enter the OceanBase service port. |
14+
| Username | Set the username for OceanBase connection. |
15+
| Password | Set the password for OceanBase connection. |
16+
| Database name | Enter the database name of the OceanBase connection. |
17+
| Compatible mode | Set the compatible mode of the OceanBase connection. |
18+
| Jdbc connection parameters | Parameter settings for OceanBase connection, in JSON format. |
19+
20+
## Native Supported
21+
22+
No, you need to import the OceanBase jdbc driver [oceanbase-client](https://mvnrepository.com/artifact/com.oceanbase/oceanbase-client) first, refer to the section example in [datasource-setting](../howto/datasource-setting.md) `DataSource Center` section.
23+
24+
The compatible mode of the datasource can be 'mysql' or 'oracle', if you only use OceanBase with 'mysql' mode, you can also treat OceanBase as MySQL and manage the datasource referring to [mysql datasource](mysql.md)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# OceanBase 数据源
2+
3+
![oceanbase](../../../../img/new_ui/dev/datasource/oceanbase.png)
4+
5+
- 数据源:选择 OCEANBASE
6+
- 数据源名称:输入数据源的名称
7+
- 描述:输入数据源的描述
8+
- IP 主机名:输入连接 OceanBase 的 IP
9+
- 端口:输入连接 OceanBase 的端口
10+
- 用户名:设置连接 OceanBase 的用户名
11+
- 密码:设置连接 OceanBase 的密码
12+
- 数据库名:输入连接 OceanBase 的数据库名称
13+
- 兼容模式:输入连接 OceanBase 的兼容模式
14+
- Jdbc 连接参数:用于 OceanBase 连接的参数设置,以 JSON 形式填写
15+
16+
## 是否原生支持
17+
18+
否,使用前需要先引入 OceanBase 的 JDBC 驱动 [oceanbase-client](https://mvnrepository.com/artifact/com.oceanbase/oceanbase-client),请参考 [数据源配置](../howto/datasource-setting.md) 中的 "数据源中心" 章节。
19+
20+
OceanBase 数据源的兼容模式可以是 'mysql' 或 'oracle',如果你只使用 mysql 模式,你也可以选择将 OceanBase 数据源当作 MySQL 数据源来使用,请参考 [MySQL 数据源](mysql.md)
21+
132 KB
Loading

dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/DataSourceConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class DataSourceConstants {
3737
public static final String COM_ATHENA_JDBC_DRIVER = "com.simba.athena.jdbc.Driver";
3838
public static final String COM_TRINO_JDBC_DRIVER = "io.trino.jdbc.TrinoDriver";
3939
public static final String COM_DAMENG_JDBC_DRIVER = "dm.jdbc.driver.DmDriver";
40+
public static final String COM_OCEANBASE_JDBC_DRIVER = "com.oceanbase.jdbc.Driver";
4041

4142
/**
4243
* validation Query
@@ -71,6 +72,7 @@ public class DataSourceConstants {
7172
public static final String JDBC_ATHENA = "jdbc:awsathena://";
7273
public static final String JDBC_TRINO = "jdbc:trino://";
7374
public static final String JDBC_DAMENG = "jdbc:dm://";
75+
public static final String JDBC_OCEANBASE = "jdbc:oceanbase://";
7476

7577
/**
7678
* database type

dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-all/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
<artifactId>dolphinscheduler-datasource-mysql</artifactId>
4848
<version>${project.version}</version>
4949
</dependency>
50+
<dependency>
51+
<groupId>org.apache.dolphinscheduler</groupId>
52+
<artifactId>dolphinscheduler-datasource-oceanbase</artifactId>
53+
<version>${project.version}</version>
54+
</dependency>
5055
<dependency>
5156
<groupId>org.apache.dolphinscheduler</groupId>
5257
<artifactId>dolphinscheduler-datasource-oracle</artifactId>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one or more
4+
~ contributor license agreements. See the NOTICE file distributed with
5+
~ this work for additional information regarding copyright ownership.
6+
~ The ASF licenses this file to You under the Apache License, Version 2.0
7+
~ (the "License"); you may not use this file except in compliance with
8+
~ the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
-->
18+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20+
<modelVersion>4.0.0</modelVersion>
21+
<parent>
22+
<groupId>org.apache.dolphinscheduler</groupId>
23+
<artifactId>dolphinscheduler-datasource-plugin</artifactId>
24+
<version>dev-SNAPSHOT</version>
25+
</parent>
26+
27+
<artifactId>dolphinscheduler-datasource-oceanbase</artifactId>
28+
<packaging>jar</packaging>
29+
<name>${project.artifactId}</name>
30+
31+
<dependencies>
32+
<dependency>
33+
<groupId>org.apache.dolphinscheduler</groupId>
34+
<artifactId>dolphinscheduler-spi</artifactId>
35+
<scope>provided</scope>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.apache.dolphinscheduler</groupId>
39+
<artifactId>dolphinscheduler-datasource-api</artifactId>
40+
<version>${project.version}</version>
41+
</dependency>
42+
</dependencies>
43+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.dolphinscheduler.plugin.datasource.oceanbase;
19+
20+
import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
21+
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel;
22+
import org.apache.dolphinscheduler.spi.datasource.DataSourceClient;
23+
import org.apache.dolphinscheduler.spi.enums.DbType;
24+
25+
public class OceanBaseDataSourceChannel implements DataSourceChannel {
26+
27+
@Override
28+
public DataSourceClient createDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
29+
return new OceanBaseDataSourceClient(baseConnectionParam, dbType);
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.dolphinscheduler.plugin.datasource.oceanbase;
19+
20+
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel;
21+
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannelFactory;
22+
23+
import com.google.auto.service.AutoService;
24+
25+
@AutoService(DataSourceChannelFactory.class)
26+
public class OceanBaseDataSourceChannelFactory implements DataSourceChannelFactory {
27+
28+
@Override
29+
public String getName() {
30+
return "oceanbase";
31+
}
32+
33+
@Override
34+
public DataSourceChannel create() {
35+
return new OceanBaseDataSourceChannel();
36+
}
37+
}

0 commit comments

Comments
 (0)