forked from apache/dolphinscheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature][DataSource] add oceanbase datasource (apache#13675)
Co-authored-by: Jay Chung <[email protected]>
- Loading branch information
1 parent
c9066e8
commit 35d8e8a
Showing
21 changed files
with
525 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# OceanBase | ||
|
||
 | ||
|
||
## Datasource Parameters | ||
|
||
| **Datasource** | **Description** | | ||
|----------------------------|--------------------------------------------------------------| | ||
| Datasource | Select OCEANBASE. | | ||
| Datasource name | Enter the name of the DataSource. | | ||
| Description | Enter a description of the DataSource. | | ||
| IP/Host name | Enter the OceanBase service IP. | | ||
| Port | Enter the OceanBase service port. | | ||
| Username | Set the username for OceanBase connection. | | ||
| Password | Set the password for OceanBase connection. | | ||
| Database name | Enter the database name of the OceanBase connection. | | ||
| Compatible mode | Set the compatible mode of the OceanBase connection. | | ||
| Jdbc connection parameters | Parameter settings for OceanBase connection, in JSON format. | | ||
|
||
## Native Supported | ||
|
||
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. | ||
|
||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# OceanBase 数据源 | ||
|
||
 | ||
|
||
- 数据源:选择 OCEANBASE | ||
- 数据源名称:输入数据源的名称 | ||
- 描述:输入数据源的描述 | ||
- IP 主机名:输入连接 OceanBase 的 IP | ||
- 端口:输入连接 OceanBase 的端口 | ||
- 用户名:设置连接 OceanBase 的用户名 | ||
- 密码:设置连接 OceanBase 的密码 | ||
- 数据库名:输入连接 OceanBase 的数据库名称 | ||
- 兼容模式:输入连接 OceanBase 的兼容模式 | ||
- Jdbc 连接参数:用于 OceanBase 连接的参数设置,以 JSON 形式填写 | ||
|
||
## 是否原生支持 | ||
|
||
否,使用前需要先引入 OceanBase 的 JDBC 驱动 [oceanbase-client](https://mvnrepository.com/artifact/com.oceanbase/oceanbase-client),请参考 [数据源配置](../howto/datasource-setting.md) 中的 "数据源中心" 章节。 | ||
|
||
OceanBase 数据源的兼容模式可以是 'mysql' 或 'oracle',如果你只使用 mysql 模式,你也可以选择将 OceanBase 数据源当作 MySQL 数据源来使用,请参考 [MySQL 数据源](mysql.md) | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-oceanbase/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
~ contributor license agreements. See the NOTICE file distributed with | ||
~ this work for additional information regarding copyright ownership. | ||
~ The ASF licenses this file to You under the Apache License, Version 2.0 | ||
~ (the "License"); you may not use this file except in compliance with | ||
~ the License. You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.apache.dolphinscheduler</groupId> | ||
<artifactId>dolphinscheduler-datasource-plugin</artifactId> | ||
<version>dev-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>dolphinscheduler-datasource-oceanbase</artifactId> | ||
<packaging>jar</packaging> | ||
<name>${project.artifactId}</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.dolphinscheduler</groupId> | ||
<artifactId>dolphinscheduler-spi</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.dolphinscheduler</groupId> | ||
<artifactId>dolphinscheduler-datasource-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
31 changes: 31 additions & 0 deletions
31
...a/org/apache/dolphinscheduler/plugin/datasource/oceanbase/OceanBaseDataSourceChannel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.plugin.datasource.oceanbase; | ||
|
||
import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam; | ||
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel; | ||
import org.apache.dolphinscheduler.spi.datasource.DataSourceClient; | ||
import org.apache.dolphinscheduler.spi.enums.DbType; | ||
|
||
public class OceanBaseDataSourceChannel implements DataSourceChannel { | ||
|
||
@Override | ||
public DataSourceClient createDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) { | ||
return new OceanBaseDataSourceClient(baseConnectionParam, dbType); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...pache/dolphinscheduler/plugin/datasource/oceanbase/OceanBaseDataSourceChannelFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.plugin.datasource.oceanbase; | ||
|
||
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel; | ||
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannelFactory; | ||
|
||
import com.google.auto.service.AutoService; | ||
|
||
@AutoService(DataSourceChannelFactory.class) | ||
public class OceanBaseDataSourceChannelFactory implements DataSourceChannelFactory { | ||
|
||
@Override | ||
public String getName() { | ||
return "oceanbase"; | ||
} | ||
|
||
@Override | ||
public DataSourceChannel create() { | ||
return new OceanBaseDataSourceChannel(); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...va/org/apache/dolphinscheduler/plugin/datasource/oceanbase/OceanBaseDataSourceClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.plugin.datasource.oceanbase; | ||
|
||
import org.apache.dolphinscheduler.plugin.datasource.api.client.CommonDataSourceClient; | ||
import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam; | ||
import org.apache.dolphinscheduler.spi.enums.DbType; | ||
|
||
public class OceanBaseDataSourceClient extends CommonDataSourceClient { | ||
|
||
public OceanBaseDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) { | ||
super(baseConnectionParam, dbType); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...g/apache/dolphinscheduler/plugin/datasource/oceanbase/param/OceanBaseConnectionParam.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.plugin.datasource.oceanbase.param; | ||
|
||
import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class OceanBaseConnectionParam extends BaseConnectionParam { | ||
|
||
protected String compatibleMode; | ||
} |
39 changes: 39 additions & 0 deletions
39
...pache/dolphinscheduler/plugin/datasource/oceanbase/param/OceanBaseDataSourceParamDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.dolphinscheduler.plugin.datasource.oceanbase.param; | ||
|
||
import org.apache.dolphinscheduler.plugin.datasource.api.datasource.BaseDataSourceParamDTO; | ||
import org.apache.dolphinscheduler.spi.enums.DbType; | ||
|
||
public class OceanBaseDataSourceParamDTO extends BaseDataSourceParamDTO { | ||
|
||
protected String compatibleMode; | ||
|
||
public String getCompatibleMode() { | ||
return compatibleMode; | ||
} | ||
|
||
public void setCompatibleMode(String compatibleMode) { | ||
this.compatibleMode = compatibleMode; | ||
} | ||
|
||
@Override | ||
public DbType getType() { | ||
return DbType.OCEANBASE; | ||
} | ||
} |
Oops, something went wrong.