Skip to content

Commit

Permalink
[DS-15953][feat] add dolphindb datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
yinxiaolog authored and ruanwenjun committed Jul 10, 2024
1 parent fb8f3ed commit 4d8205d
Show file tree
Hide file tree
Showing 32 changed files with 927 additions and 7 deletions.
8 changes: 8 additions & 0 deletions docs/configs/docsdev.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ export default {
title: 'Remote Shell',
link: '/en-us/docs/dev/user_doc/guide/task/remoteshell.html',
},
{
title: 'DolphinDB',
link: '/en-us/docs/dev/user_doc/guide/datasource/dolphindb.html',
},
],
},
{
Expand Down Expand Up @@ -965,6 +969,10 @@ export default {
title: 'Remote Shell',
link: '/zh-cn/docs/dev/user_doc/guide/task/remoteshell.html',
},
{
title: 'DolphinDB',
link: '/zh-cn/docs/dev/user_doc/guide/datasource/dolphindb.html',
},
],
},
{
Expand Down
20 changes: 20 additions & 0 deletions docs/docs/en/guide/datasource/dolphindb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# DolphinDB

![dolphindb](../../../../img/new_ui/dev/datasource/dolphindb-en.png)

## Datasource Parameters

| **Parameter** | **Description** |
|----------------------------|--------------------------------------------------------------|
| Datasource | Select DOLPHINDB. |
| Datasource Name | Enter the name of the DataSource. |
| Description | Enter a description of the DataSource. |
| IP/Host Name | Enter the DolphinDB service IP. |
| Port | Enter the DolphinDB service port. |
| Username | Set the username for DolphinDB connection. |
| Password | Set the password for DolphinDB connection. |
| Jdbc connection parameters | Parameter settings for DolphinDB connection, in JSON format. |

## Native Supported

Yes, could use this datasource by default.
18 changes: 18 additions & 0 deletions docs/docs/zh/guide/datasource/dolphindb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# DOLPHINDB 数据源

![dolphindb](../../../../img/new_ui/dev/datasource/dolphindb-zh.png)

| **参数名称** | **参数描述** |
|-----------|----------------------------------|
| 数据源 | 选择 DOLPHINDB |
| 数据源名称 | 输入数据源的名称 |
| 描述 | 输入数据源的描述 |
| IP 主机名 | 输入连接 DOLPHINDB 的 IP |
| 端口 | 输入连接 DOLPHINDB 的端口 |
| 用户名 | 设置连接 DOLPHINDB 的用户名 |
| 密码 | 设置连接 DOLPHINDB 的密码 |
| JDBC 连接参数 | 用于 DOLPHINDB 连接的参数设置,以 JSON 形式填写 |

## 是否原生支持

是,数据源不需要任务附加操作即可使用。
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/new_ui/dev/datasource/dolphindb-zh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions dolphinscheduler-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<cron-utils.version>9.1.6</cron-utils.version>
<h2.version>2.2.220</h2.version>
<mysql-connector.version>8.0.33</mysql-connector.version>
<dolphindb-jdbc.version>3.00.0.1</dolphindb-jdbc.version>
<vertica-jdbc.version>12.0.4-0</vertica-jdbc.version>
<oracle-jdbc.version>21.5.0.0</oracle-jdbc.version>
<dameng-jdbc.version>8.1.2.79</dameng-jdbc.version>
Expand Down Expand Up @@ -360,6 +361,11 @@
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
</dependency>

<!--protostuff-->
<dependency>
Expand Down Expand Up @@ -405,6 +411,12 @@
<version>${dameng-jdbc.version}</version>
</dependency>

<dependency>
<groupId>com.dolphindb</groupId>
<artifactId>jdbc</artifactId>
<version>${dolphindb-jdbc.version}</version>
</dependency>

<dependency>
<groupId>com.vertica.jdbc</groupId>
<artifactId>vertica-jdbc</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions dolphinscheduler-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class DataSourceConstants {
public static final String NET_SNOWFLAKE_JDBC_DRIVER = "net.snowflake.client.jdbc.SnowflakeDriver";
public static final String COM_VERTICA_JDBC_DRIVER = "com.vertica.jdbc.Driver";
public static final String COM_HANA_DB_JDBC_DRIVER = "com.sap.db.jdbc.Driver";
public static final String COM_DOLPHINDB_JDBC_DRIVER = "com.dolphindb.jdbc.Driver";

/**
* validation Query
Expand All @@ -66,6 +67,7 @@ public class DataSourceConstants {
public static final String VERTICA_VALIDATION_QUERY = "select 1";

public static final String HANA_VALIDATION_QUERY = "select 1 from DUMMY";
public static final String DOLPHINDB_VALIDATION_QUERY = "select 1";

/**
* jdbc url
Expand All @@ -91,6 +93,7 @@ public class DataSourceConstants {
public static final String JDBC_SNOWFLAKE = "jdbc:snowflake://";
public static final String JDBC_VERTICA = "jdbc:vertica://";
public static final String JDBC_HANA = "jdbc:sap://";
public static final String JDBC_DOLPHINDB = "jdbc:dolphindb://";

/**
* database type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.node.TextNode;
import com.fasterxml.jackson.databind.type.CollectionType;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.google.common.base.Strings;

/**
Expand All @@ -81,6 +82,7 @@ public final class JSONUtils {
.addModule(new SimpleModule()
.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer())
.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer()))
.addModule(new JavaTimeModule())
.defaultTimeZone(TimeZone.getDefault())
.defaultDateFormat(new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,10 @@
<artifactId>dolphinscheduler-datasource-hana</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-datasource-dolphindb</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?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-dolphindb</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>

<dependency>
<groupId>com.dolphindb</groupId>
<artifactId>jdbc</artifactId>
</dependency>

</dependencies>

</project>
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.dolphindb;

import org.apache.dolphinscheduler.plugin.datasource.api.client.BaseAdHocDataSourceClient;
import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
import org.apache.dolphinscheduler.spi.enums.DbType;

public class DolphinDBAdHocDataSourceClient extends BaseAdHocDataSourceClient {

public DolphinDBAdHocDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
super(baseConnectionParam, dbType);
}
}
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.dolphindb;

import org.apache.dolphinscheduler.spi.datasource.AdHocDataSourceClient;
import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel;
import org.apache.dolphinscheduler.spi.datasource.PooledDataSourceClient;
import org.apache.dolphinscheduler.spi.enums.DbType;

public class DolphinDBDataSourceChannel implements DataSourceChannel {

@Override
public AdHocDataSourceClient createAdHocDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
return new DolphinDBAdHocDataSourceClient(baseConnectionParam, dbType);
}

@Override
public PooledDataSourceClient createPooledDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
return new DolphinDBPooledDataSourceClient(baseConnectionParam, dbType);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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.dolphindb;

import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel;
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannelFactory;
import org.apache.dolphinscheduler.spi.enums.DbType;

import com.google.auto.service.AutoService;

@AutoService(DataSourceChannelFactory.class)
public class DolphinDBDataSourceChannelFactory implements DataSourceChannelFactory {

@Override
public String getName() {
return DbType.DOLPHINDB.getName();
}

@Override
public DataSourceChannel create() {
return new DolphinDBDataSourceChannel();
}
}
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.dolphindb;

import org.apache.dolphinscheduler.plugin.datasource.api.client.BasePooledDataSourceClient;
import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
import org.apache.dolphinscheduler.spi.enums.DbType;

public class DolphinDBPooledDataSourceClient extends BasePooledDataSourceClient {

public DolphinDBPooledDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
super(baseConnectionParam, dbType);
}
}
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.dolphindb.param;

import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;

public class DolphinDBConnectionParam extends BaseConnectionParam {

@Override
public String toString() {
return "DolphinDBConnectionParam{"
+ "user='" + user + '\''
+ ", password='" + password + '\''
+ ", address='" + address + '\''
+ ", jdbcUrl='" + jdbcUrl + '\''
+ ", driverLocation='" + driverLocation + '\''
+ ", driverClassName='" + driverClassName + '\''
+ ", validationQuery='" + validationQuery + '\''
+ ", other='" + other + '\''
+ '}';
}
}
Loading

0 comments on commit 4d8205d

Please sign in to comment.