You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ki...@apache.org on 2021/08/27 07:02:29 UTC
[dolphinscheduler] branch task-plugin updated: [Feature][SPI] Task
(#6044)
This is an automated email from the ASF dual-hosted git repository.
kirs pushed a commit to branch task-plugin
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/task-plugin by this push:
new 22c5292 [Feature][SPI] Task (#6044)
22c5292 is described below
commit 22c5292b935bcb130615f33e89e9e420fbb73fed
Author: Kerwin <37...@users.noreply.github.com>
AuthorDate: Fri Aug 27 15:02:24 2021 +0800
[Feature][SPI] Task (#6044)
---
README.md | 4 +-
.../dingtalk/DingTalkAlertChannelFactory.java | 4 +-
.../alert/email/EmailAlertChannelFactory.java | 4 +-
.../plugin/alert/email/EmailAlertChannelTest.java | 7 +-
.../alert/feishu/FeiShuAlertChannelFactory.java | 4 +-
.../plugin/alert/http/HttpAlertChannelFactory.java | 2 +-
.../plugin/alert/http/HttpAlertChannelTest.java | 2 +-
.../alert/script/ScriptAlertChannelFactory.java | 4 +-
.../alert/slack/SlackAlertChannelFactory.java | 2 +-
.../alert/wechat/WeChatAlertChannelFactory.java | 4 +-
.../alert/plugin/EmailAlertPluginTest.java | 6 +-
.../dao/mapper/ProcessDefinitionMapper.xml | 4 +-
.../dolphinscheduler/dao/mapper/ProjectMapper.xml | 4 +-
.../src/main/provisio/dolphinscheduler.xml | 6 +
dolphinscheduler-server/pom.xml | 1 +
.../server/worker/WorkerServer.java | 32 ++-
.../server/worker/config/WorkerConfig.java | 33 +++
.../server/worker/plugin/TaskPluginManager.java | 4 +
.../worker/processor/TaskExecuteProcessor.java | 8 +-
.../server/worker/runner/TaskExecuteThread.java | 56 ++--
.../server/worker/task/sql/SqlTask.java | 14 +-
.../src/main/resources/worker.properties | 8 +
.../dolphinscheduler/spi/params/base/FormType.java | 16 +-
.../spi/params/base/ParamsProps.java | 15 ++
.../spi/params/base/PluginParams.java | 12 +-
.../base/ResizeType.java} | 16 +-
.../spi/params/checkbox/CheckboxParam.java | 87 ++++++
.../spi/params/checkbox/CheckboxParamProps.java | 61 +++++
.../{InputParam.java => fswitch/SwitchParam.java} | 64 +++--
.../spi/params/fswitch/SwitchParamProps.java | 156 +++++++++++
.../spi/params/{ => input}/InputParam.java | 58 ++--
.../spi/params/input/InputParamProps.java | 297 +++++++++++++++++++++
.../InputNumberParam.java} | 64 +++--
.../params/inputNumber/InputNumberParamProps.java | 130 +++++++++
.../spi/params/{ => radio}/RadioParam.java | 71 +++--
.../RadioParamProps.java} | 38 +--
.../{RadioParam.java => select/SelectParam.java} | 81 +++---
.../spi/params/select/SelectParamProps.java | 239 +++++++++++++++++
.../dolphinscheduler/spi/task/TaskChannel.java | 2 +-
.../spi/params/PluginParamsTransferTest.java | 4 +-
.../dolphinscheduler-task-api/pom.xml | 9 +-
.../dolphinscheduler-task-flink/pom.xml | 5 +
.../dolphinscheduler-task-python/pom.xml | 6 +
.../dolphinscheduler-task-shell/pom.xml | 9 +-
.../plugin/task/shell/ShellTaskChannelFactory.java | 24 +-
.../plugin/task/shell/ShellTaskConstants.java | 11 +-
.../dolphinscheduler-task-spark/pom.xml | 6 +
pom.xml | 19 +-
48 files changed, 1485 insertions(+), 228 deletions(-)
diff --git a/README.md b/README.md
index 7bccebc..9582619 100644
--- a/README.md
+++ b/README.md
@@ -80,7 +80,7 @@ dolphinscheduler-dist/target/apache-dolphinscheduler-${latest.release.version}-s
## Thanks
-DolphinScheduler is based on a lot of excellent open-source projects, such as Google guava, guice, grpc, netty, ali bonecp, quartz, and many open-source projects of Apache and so on.
+DolphinScheduler is based on a lot of excellent open-source projects, such as Google guava, guice, grpc, netty, quartz, and many open-source projects of Apache and so on.
We would like to express our deep gratitude to all the open-source projects used in Dolphin Scheduler. We hope that we are not only the beneficiaries of open-source, but also give back to the community. Besides, we hope everyone who have the same enthusiasm and passion for open source could join in and contribute to the open-source community!
## Get Help
@@ -92,7 +92,7 @@ We would like to express our deep gratitude to all the open-source projects used
You are very welcome to communicate with the developers and users of Dolphin Scheduler. There are two ways to find them:
1. Join the Slack channel by [this invitation link](https://join.slack.com/t/asf-dolphinscheduler/shared_invite/zt-omtdhuio-_JISsxYhiVsltmC5h38yfw).
-2. Follow the [Twitter account of Dolphin Scheduler](https://twitter.com/dolphinschedule) and get the latest news on time.
+2. Follow the [Twitter account of DolphinScheduler](https://twitter.com/dolphinschedule) and get the latest news on time.
### Contributor over time
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkAlertChannelFactory.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkAlertChannelFactory.java
index b0f07b6..61518b6 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkAlertChannelFactory.java
+++ b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkAlertChannelFactory.java
@@ -24,9 +24,9 @@ import static org.apache.dolphinscheduler.spi.utils.Constants.STRING_YES;
import org.apache.dolphinscheduler.spi.alert.AlertChannel;
import org.apache.dolphinscheduler.spi.alert.AlertChannelFactory;
-import org.apache.dolphinscheduler.spi.params.InputParam;
+import org.apache.dolphinscheduler.spi.params.input.InputParam;
import org.apache.dolphinscheduler.spi.params.PasswordParam;
-import org.apache.dolphinscheduler.spi.params.RadioParam;
+import org.apache.dolphinscheduler.spi.params.radio.RadioParam;
import org.apache.dolphinscheduler.spi.params.base.ParamsOptions;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelFactory.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelFactory.java
index 41395fc..2eefb49 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelFactory.java
+++ b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelFactory.java
@@ -26,9 +26,9 @@ import org.apache.dolphinscheduler.spi.alert.AlertChannel;
import org.apache.dolphinscheduler.spi.alert.AlertChannelFactory;
import org.apache.dolphinscheduler.spi.alert.AlertConstants;
import org.apache.dolphinscheduler.spi.alert.ShowType;
-import org.apache.dolphinscheduler.spi.params.InputParam;
+import org.apache.dolphinscheduler.spi.params.input.InputParam;
import org.apache.dolphinscheduler.spi.params.PasswordParam;
-import org.apache.dolphinscheduler.spi.params.RadioParam;
+import org.apache.dolphinscheduler.spi.params.radio.RadioParam;
import org.apache.dolphinscheduler.spi.params.base.ParamsOptions;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelTest.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelTest.java
index 2ddd42e..9a87709 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelTest.java
+++ b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelTest.java
@@ -22,11 +22,10 @@ import org.apache.dolphinscheduler.spi.alert.AlertData;
import org.apache.dolphinscheduler.spi.alert.AlertInfo;
import org.apache.dolphinscheduler.spi.alert.AlertResult;
import org.apache.dolphinscheduler.spi.alert.ShowType;
-import org.apache.dolphinscheduler.spi.params.InputParam;
+import org.apache.dolphinscheduler.spi.params.input.InputParam;
import org.apache.dolphinscheduler.spi.params.PasswordParam;
import org.apache.dolphinscheduler.spi.params.PluginParamsTransfer;
-import org.apache.dolphinscheduler.spi.params.RadioParam;
-import org.apache.dolphinscheduler.spi.params.base.DataType;
+import org.apache.dolphinscheduler.spi.params.radio.RadioParam;
import org.apache.dolphinscheduler.spi.params.base.ParamsOptions;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
@@ -142,7 +141,7 @@ public class EmailAlertChannelTest {
emailShowTypeList.add(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false));
emailShowTypeList.add(new ParamsOptions(ShowType.TABLEATTACHMENT.getDescp(), ShowType.TABLEATTACHMENT.getDescp(), false));
RadioParam showType = RadioParam.newBuilder(AlertConstants.SHOW_TYPE, "showType")
- .setParamsOptionsList(emailShowTypeList)
+ .setOptions(emailShowTypeList)
.setValue(ShowType.TABLE.getDescp())
.addValidate(Validate.newBuilder().setRequired(true).build())
.build();
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuAlertChannelFactory.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuAlertChannelFactory.java
index d85b423..6eb3376 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuAlertChannelFactory.java
+++ b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuAlertChannelFactory.java
@@ -24,9 +24,9 @@ import static org.apache.dolphinscheduler.spi.utils.Constants.STRING_YES;
import org.apache.dolphinscheduler.spi.alert.AlertChannel;
import org.apache.dolphinscheduler.spi.alert.AlertChannelFactory;
-import org.apache.dolphinscheduler.spi.params.InputParam;
+import org.apache.dolphinscheduler.spi.params.input.InputParam;
import org.apache.dolphinscheduler.spi.params.PasswordParam;
-import org.apache.dolphinscheduler.spi.params.RadioParam;
+import org.apache.dolphinscheduler.spi.params.radio.RadioParam;
import org.apache.dolphinscheduler.spi.params.base.ParamsOptions;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelFactory.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelFactory.java
index 6b8dd30..d54885e 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelFactory.java
+++ b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelFactory.java
@@ -19,7 +19,7 @@ package org.apache.dolphinscheduler.plugin.alert.http;
import org.apache.dolphinscheduler.spi.alert.AlertChannel;
import org.apache.dolphinscheduler.spi.alert.AlertChannelFactory;
-import org.apache.dolphinscheduler.spi.params.InputParam;
+import org.apache.dolphinscheduler.spi.params.input.InputParam;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/test/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelTest.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/test/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelTest.java
index 4d385e8..2d29407 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/test/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelTest.java
+++ b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/test/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelTest.java
@@ -20,7 +20,7 @@ package org.apache.dolphinscheduler.plugin.alert.http;
import org.apache.dolphinscheduler.spi.alert.AlertData;
import org.apache.dolphinscheduler.spi.alert.AlertInfo;
import org.apache.dolphinscheduler.spi.alert.AlertResult;
-import org.apache.dolphinscheduler.spi.params.InputParam;
+import org.apache.dolphinscheduler.spi.params.input.InputParam;
import org.apache.dolphinscheduler.spi.params.PluginParamsTransfer;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptAlertChannelFactory.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptAlertChannelFactory.java
index a81cb4f..67cfc39 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptAlertChannelFactory.java
+++ b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptAlertChannelFactory.java
@@ -19,8 +19,8 @@ package org.apache.dolphinscheduler.plugin.alert.script;
import org.apache.dolphinscheduler.spi.alert.AlertChannel;
import org.apache.dolphinscheduler.spi.alert.AlertChannelFactory;
-import org.apache.dolphinscheduler.spi.params.InputParam;
-import org.apache.dolphinscheduler.spi.params.RadioParam;
+import org.apache.dolphinscheduler.spi.params.input.InputParam;
+import org.apache.dolphinscheduler.spi.params.radio.RadioParam;
import org.apache.dolphinscheduler.spi.params.base.ParamsOptions;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-slack/src/main/java/org/apache/dolphinscheduler/plugin/alert/slack/SlackAlertChannelFactory.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-slack/src/main/java/org/apache/dolphinscheduler/plugin/alert/slack/SlackAlertChannelFactory.java
index f3f135e..d569764 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-slack/src/main/java/org/apache/dolphinscheduler/plugin/alert/slack/SlackAlertChannelFactory.java
+++ b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-slack/src/main/java/org/apache/dolphinscheduler/plugin/alert/slack/SlackAlertChannelFactory.java
@@ -19,7 +19,7 @@ package org.apache.dolphinscheduler.plugin.alert.slack;
import org.apache.dolphinscheduler.spi.alert.AlertChannel;
import org.apache.dolphinscheduler.spi.alert.AlertChannelFactory;
-import org.apache.dolphinscheduler.spi.params.InputParam;
+import org.apache.dolphinscheduler.spi.params.input.InputParam;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java
index 636c571..25b1318 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java
+++ b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java
@@ -21,8 +21,8 @@ import org.apache.dolphinscheduler.spi.alert.AlertChannel;
import org.apache.dolphinscheduler.spi.alert.AlertChannelFactory;
import org.apache.dolphinscheduler.spi.alert.AlertConstants;
import org.apache.dolphinscheduler.spi.alert.ShowType;
-import org.apache.dolphinscheduler.spi.params.InputParam;
-import org.apache.dolphinscheduler.spi.params.RadioParam;
+import org.apache.dolphinscheduler.spi.params.input.InputParam;
+import org.apache.dolphinscheduler.spi.params.radio.RadioParam;
import org.apache.dolphinscheduler.spi.params.base.ParamsOptions;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
diff --git a/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java b/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java
index 6d1727f..5c31225 100644
--- a/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java
+++ b/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java
@@ -32,10 +32,10 @@ import org.apache.dolphinscheduler.dao.entity.AlertPluginInstance;
import org.apache.dolphinscheduler.dao.entity.PluginDefine;
import org.apache.dolphinscheduler.spi.alert.AlertConstants;
import org.apache.dolphinscheduler.spi.alert.ShowType;
-import org.apache.dolphinscheduler.spi.params.InputParam;
+import org.apache.dolphinscheduler.spi.params.input.InputParam;
import org.apache.dolphinscheduler.spi.params.PasswordParam;
import org.apache.dolphinscheduler.spi.params.PluginParamsTransfer;
-import org.apache.dolphinscheduler.spi.params.RadioParam;
+import org.apache.dolphinscheduler.spi.params.radio.RadioParam;
import org.apache.dolphinscheduler.spi.params.base.DataType;
import org.apache.dolphinscheduler.spi.params.base.ParamsOptions;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
@@ -217,7 +217,7 @@ public class EmailAlertPluginTest {
emailShowTypeList.add(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false));
emailShowTypeList.add(new ParamsOptions(ShowType.TABLEATTACHMENT.getDescp(), ShowType.TABLEATTACHMENT.getDescp(), false));
RadioParam showType = RadioParam.newBuilder(AlertConstants.SHOW_TYPE, "showType")
- .setParamsOptionsList(emailShowTypeList)
+ .setOptions(emailShowTypeList)
.setValue(ShowType.TABLE.getDescp())
.addValidate(Validate.newBuilder().setRequired(true).build())
.build();
diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.xml
index a16480f..fec3342 100644
--- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.xml
+++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionMapper.xml
@@ -80,7 +80,9 @@
left join t_ds_user tu on td.user_id = tu.id
where td.project_code = #{projectCode}
<if test=" searchVal != null and searchVal != ''">
- and td.name like concat('%', #{searchVal}, '%')
+ AND (td.name like concat('%', #{searchVal}, '%')
+ OR td.description like concat('%', #{searchVal}, '%')
+ )
</if>
<if test=" userId != 0">
and td.user_id = #{userId}
diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProjectMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProjectMapper.xml
index 59a2473..1b44c22 100644
--- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProjectMapper.xml
+++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProjectMapper.xml
@@ -88,7 +88,9 @@
)
</if>
<if test="searchName!=null and searchName != ''">
- and p.name like concat('%', #{searchName}, '%')
+ AND (p.name LIKE concat('%', #{searchName}, '%')
+ OR p.description LIKE concat('%', #{searchName}, '%')
+ )
</if>
order by p.create_time desc
</select>
diff --git a/dolphinscheduler-dist/src/main/provisio/dolphinscheduler.xml b/dolphinscheduler-dist/src/main/provisio/dolphinscheduler.xml
index e5689b8..557a993 100644
--- a/dolphinscheduler-dist/src/main/provisio/dolphinscheduler.xml
+++ b/dolphinscheduler-dist/src/main/provisio/dolphinscheduler.xml
@@ -74,4 +74,10 @@
<unpack/>
</artifact>
</artifactSet>
+ <!-- Task Plugins -->
+ <artifactSet to="lib/plugin/task/shell">
+ <artifact id="${project.groupId}:dolphinscheduler-task-shell:zip:${project.version}">
+ <unpack/>
+ </artifact>
+ </artifactSet>
</runtime>
\ No newline at end of file
diff --git a/dolphinscheduler-server/pom.xml b/dolphinscheduler-server/pom.xml
index 03544ad..7c59fb6 100644
--- a/dolphinscheduler-server/pom.xml
+++ b/dolphinscheduler-server/pom.xml
@@ -86,6 +86,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
index 91566b1..cd744a1 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/WorkerServer.java
@@ -17,14 +17,17 @@
package org.apache.dolphinscheduler.server.worker;
+import com.google.common.collect.ImmutableList;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.IStoppable;
import org.apache.dolphinscheduler.common.enums.NodeType;
import org.apache.dolphinscheduler.common.thread.Stopper;
+import org.apache.dolphinscheduler.common.utils.PropertyUtils;
import org.apache.dolphinscheduler.remote.NettyRemotingServer;
import org.apache.dolphinscheduler.remote.command.CommandType;
import org.apache.dolphinscheduler.remote.config.NettyServerConfig;
import org.apache.dolphinscheduler.server.worker.config.WorkerConfig;
+import org.apache.dolphinscheduler.server.worker.plugin.TaskPluginManager;
import org.apache.dolphinscheduler.server.worker.processor.DBTaskAckProcessor;
import org.apache.dolphinscheduler.server.worker.processor.DBTaskResponseProcessor;
import org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessor;
@@ -39,6 +42,9 @@ import java.util.Set;
import javax.annotation.PostConstruct;
+import org.apache.dolphinscheduler.spi.plugin.DolphinPluginLoader;
+import org.apache.dolphinscheduler.spi.plugin.DolphinPluginManagerConfig;
+import org.apache.dolphinscheduler.spi.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -101,6 +107,8 @@ public class WorkerServer implements IStoppable {
@Autowired
private WorkerManagerThread workerManagerThread;
+ private TaskPluginManager taskPluginManager;
+
/**
* worker server startup, not use web service
*
@@ -119,11 +127,13 @@ public class WorkerServer implements IStoppable {
// alert-server client registry
alertClientService = new AlertClientService(workerConfig.getAlertListenHost(), Constants.ALERT_RPC_PORT);
+ // init task plugin
+ initTaskPlugin();
// init remoting server
NettyServerConfig serverConfig = new NettyServerConfig();
serverConfig.setListenPort(workerConfig.getListenPort());
this.nettyRemotingServer = new NettyRemotingServer(serverConfig);
- this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_REQUEST, new TaskExecuteProcessor(alertClientService));
+ this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_REQUEST, new TaskExecuteProcessor(alertClientService, taskPluginManager));
this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_REQUEST, new TaskKillProcessor());
this.nettyRemotingServer.registerProcessor(CommandType.DB_TASK_ACK, new DBTaskAckProcessor());
this.nettyRemotingServer.registerProcessor(CommandType.DB_TASK_RESPONSE, new DBTaskResponseProcessor());
@@ -157,6 +167,26 @@ public class WorkerServer implements IStoppable {
}));
}
+ private void initTaskPlugin() {
+ taskPluginManager = new TaskPluginManager();
+ DolphinPluginManagerConfig taskPluginManagerConfig = new DolphinPluginManagerConfig();
+ taskPluginManagerConfig.setPlugins(workerConfig.getTaskPluginBinding());
+ if (StringUtils.isNotBlank(workerConfig.getTaskPluginDir())) {
+ taskPluginManagerConfig.setInstalledPluginsDir(workerConfig.getTaskPluginDir().trim());
+ }
+
+ if (StringUtils.isNotBlank(workerConfig.getMavenLocalRepository())) {
+ taskPluginManagerConfig.setMavenLocalRepository(workerConfig.getMavenLocalRepository().trim());
+ }
+
+ DolphinPluginLoader alertPluginLoader = new DolphinPluginLoader(taskPluginManagerConfig, ImmutableList.of(taskPluginManager));
+ try {
+ alertPluginLoader.loadPlugins();
+ } catch (Exception e) {
+ throw new RuntimeException("Load Task Plugin Failed !", e);
+ }
+ }
+
public void close(String cause) {
try {
diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/config/WorkerConfig.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/config/WorkerConfig.java
index 2c71a97..a3feb77 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/config/WorkerConfig.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/config/WorkerConfig.java
@@ -56,6 +56,15 @@ public class WorkerConfig {
@Value("${alert.listen.host:localhost}")
private String alertListenHost;
+ @Value("${task.plugin.dir:}")
+ private String taskPluginDir;
+
+ @Value("${maven.local.repository:}")
+ private String mavenLocalRepository;
+
+ @Value("${task.plugin.binding:}")
+ private String taskPluginBinding;
+
public int getListenPort() {
return listenPort;
}
@@ -130,4 +139,28 @@ public class WorkerConfig {
public void setAlertListenHost(String alertListenHost) {
this.alertListenHost = alertListenHost;
}
+
+ public String getTaskPluginDir() {
+ return taskPluginDir;
+ }
+
+ public void setTaskPluginDir(String taskPluginDir) {
+ this.taskPluginDir = taskPluginDir;
+ }
+
+ public String getMavenLocalRepository() {
+ return mavenLocalRepository;
+ }
+
+ public void setMavenLocalRepository(String mavenLocalRepository) {
+ this.mavenLocalRepository = mavenLocalRepository;
+ }
+
+ public String getTaskPluginBinding() {
+ return taskPluginBinding;
+ }
+
+ public void setTaskPluginBinding(String taskPluginBinding) {
+ this.taskPluginBinding = taskPluginBinding;
+ }
}
\ No newline at end of file
diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/plugin/TaskPluginManager.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/plugin/TaskPluginManager.java
index 7f51d8d..a76a1bb 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/plugin/TaskPluginManager.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/plugin/TaskPluginManager.java
@@ -83,6 +83,10 @@ public class TaskPluginManager extends AbstractDolphinPluginManager {
private PluginDao pluginDao = DaoFactory.getDaoInstance(PluginDao.class);
+ public Map<String, TaskChannel> getTaskChannelMap() {
+ return taskChannelMap;
+ }
+
@Override
public void installPlugin(DolphinSchedulerPlugin dolphinSchedulerPlugin) {
for (TaskChannelFactory taskChannelFactory : dolphinSchedulerPlugin.getTaskChannelFactorys()) {
diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskExecuteProcessor.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskExecuteProcessor.java
index 047dc6d..718c949 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskExecuteProcessor.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskExecuteProcessor.java
@@ -39,6 +39,7 @@ import org.apache.dolphinscheduler.server.worker.cache.ResponceCache;
import org.apache.dolphinscheduler.server.worker.cache.TaskExecutionContextCacheManager;
import org.apache.dolphinscheduler.server.worker.cache.impl.TaskExecutionContextCacheManagerImpl;
import org.apache.dolphinscheduler.server.worker.config.WorkerConfig;
+import org.apache.dolphinscheduler.server.worker.plugin.TaskPluginManager;
import org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread;
import org.apache.dolphinscheduler.server.worker.runner.WorkerManagerThread;
import org.apache.dolphinscheduler.service.alert.AlertClientService;
@@ -74,6 +75,8 @@ public class TaskExecuteProcessor implements NettyRequestProcessor {
*/
private AlertClientService alertClientService;
+ private TaskPluginManager taskPluginManager;
+
/**
* taskExecutionContextCacheManager
*/
@@ -102,9 +105,10 @@ public class TaskExecuteProcessor implements NettyRequestProcessor {
taskExecutionContextCacheManager.cacheTaskExecutionContext(preTaskCache);
}
- public TaskExecuteProcessor(AlertClientService alertClientService) {
+ public TaskExecuteProcessor(AlertClientService alertClientService, TaskPluginManager taskPluginManager) {
this();
this.alertClientService = alertClientService;
+ this.taskPluginManager = taskPluginManager;
}
@Override
@@ -177,7 +181,7 @@ public class TaskExecuteProcessor implements NettyRequestProcessor {
this.doAck(taskExecutionContext);
// submit task to manager
- if (!workerManager.offer(new TaskExecuteThread(taskExecutionContext, taskCallbackService, taskLogger, alertClientService))) {
+ if (!workerManager.offer(new TaskExecuteThread(taskExecutionContext, taskCallbackService, taskLogger, alertClientService, taskPluginManager))) {
logger.info("submit task to manager error, queue is full, queue size is {}", workerManager.getQueueSize());
}
}
diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
index 50847f7..5975294 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
@@ -35,8 +35,8 @@ import org.apache.dolphinscheduler.server.entity.TaskExecutionContext;
import org.apache.dolphinscheduler.server.worker.cache.ResponceCache;
import org.apache.dolphinscheduler.server.worker.cache.TaskExecutionContextCacheManager;
import org.apache.dolphinscheduler.server.worker.cache.impl.TaskExecutionContextCacheManagerImpl;
+import org.apache.dolphinscheduler.server.worker.plugin.TaskPluginManager;
import org.apache.dolphinscheduler.server.worker.processor.TaskCallbackService;
-import org.apache.dolphinscheduler.server.worker.task.AbstractTask;
import org.apache.dolphinscheduler.server.worker.task.TaskManager;
import org.apache.dolphinscheduler.service.alert.AlertClientService;
import org.apache.dolphinscheduler.service.bean.SpringApplicationContext;
@@ -55,6 +55,9 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
+import org.apache.dolphinscheduler.spi.task.AbstractTask;
+import org.apache.dolphinscheduler.spi.task.TaskChannel;
+import org.apache.dolphinscheduler.spi.task.TaskRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -100,14 +103,17 @@ public class TaskExecuteThread implements Runnable, Delayed {
*/
private AlertClientService alertClientService;
+ private TaskPluginManager taskPluginManager;
+
/**
* constructor
* @param taskExecutionContext taskExecutionContext
* @param taskCallbackService taskCallbackService
*/
- public TaskExecuteThread(TaskExecutionContext taskExecutionContext
- , TaskCallbackService taskCallbackService
- , Logger taskLogger, AlertClientService alertClientService) {
+ public TaskExecuteThread(TaskExecutionContext taskExecutionContext,
+ TaskCallbackService taskCallbackService,
+ Logger taskLogger,
+ AlertClientService alertClientService) {
this.taskExecutionContext = taskExecutionContext;
this.taskCallbackService = taskCallbackService;
this.taskExecutionContextCacheManager = SpringApplicationContext.getBean(TaskExecutionContextCacheManagerImpl.class);
@@ -115,6 +121,19 @@ public class TaskExecuteThread implements Runnable, Delayed {
this.alertClientService = alertClientService;
}
+ public TaskExecuteThread(TaskExecutionContext taskExecutionContext,
+ TaskCallbackService taskCallbackService,
+ Logger taskLogger,
+ AlertClientService alertClientService,
+ TaskPluginManager taskPluginManager) {
+ this.taskExecutionContext = taskExecutionContext;
+ this.taskCallbackService = taskCallbackService;
+ this.taskExecutionContextCacheManager = SpringApplicationContext.getBean(TaskExecutionContextCacheManagerImpl.class);
+ this.taskLogger = taskLogger;
+ this.alertClientService = alertClientService;
+ this.taskPluginManager = taskPluginManager;
+ }
+
@Override
public void run() {
@@ -150,24 +169,31 @@ public class TaskExecuteThread implements Runnable, Delayed {
taskExecutionContext.getProcessInstanceId(),
taskExecutionContext.getTaskInstanceId()));
- task = TaskManager.newTask(taskExecutionContext, taskLogger, alertClientService);
+ TaskChannel taskChannel = taskPluginManager.getTaskChannelMap().get(taskExecutionContext.getTaskType());
+
+ //TODO Temporary operation, To be adjusted
+ TaskRequest taskRequest = JSONUtils.parseObject(JSONUtils.toJsonString(taskExecutionContext), TaskRequest.class);
+ task = taskChannel.createTask(taskRequest, taskLogger);
// task init
- task.init();
+ this.task.init();
//init varPool
- task.getParameters().setVarPool(taskExecutionContext.getVarPool());
+ //TODO Temporary operation, To be adjusted
+// this.task.getParameters().setVarPool(taskExecutionContext.getVarPool());
// task handle
- task.handle();
+ this.task.handle();
// task result process
- task.after();
+ this.task.after();
- responseCommand.setStatus(task.getExitStatus().getCode());
+ responseCommand.setStatus(this.task.getExitStatus().getCode());
responseCommand.setEndTime(new Date());
- responseCommand.setProcessId(task.getProcessId());
- responseCommand.setAppIds(task.getAppIds());
- responseCommand.setVarPool(JSONUtils.toJsonString(task.getParameters().getVarPool()));
- logger.info("task instance id : {},task final status : {}", taskExecutionContext.getTaskInstanceId(), task.getExitStatus());
- } catch (Exception e) {
+ responseCommand.setProcessId(this.task.getProcessId());
+ responseCommand.setAppIds(this.task.getAppIds());
+ //TODO Temporary operation, To be adjusted
+// responseCommand.setVarPool(JSONUtils.toJsonString(this.task.getParameters().getVarPool()));
+ logger.info("task instance id : {},task final status : {}", taskExecutionContext.getTaskInstanceId(), this.task.getExitStatus());
+ } catch (Throwable e) {
+ e.printStackTrace();
logger.error("task scheduler failure", e);
kill();
responseCommand.setStatus(ExecutionStatus.FAILURE.getCode());
diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
index 9dd8b51..3c4b3ab 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
@@ -42,6 +42,8 @@ import org.apache.dolphinscheduler.server.worker.task.AbstractTask;
import org.apache.dolphinscheduler.service.alert.AlertClientService;
import org.apache.dolphinscheduler.service.bean.SpringApplicationContext;
+import org.apache.commons.collections.MapUtils;
+
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -271,11 +273,11 @@ public class SqlTask extends AbstractTask {
public String setNonQuerySqlReturn(String updateResult, List<Property> properties) {
String result = null;
- for (Property info :properties) {
+ for (Property info : properties) {
if (Direct.OUT == info.getDirect()) {
- List<Map<String,String>> updateRL = new ArrayList<>();
- Map<String,String> updateRM = new HashMap<>();
- updateRM.put(info.getProp(),updateResult);
+ List<Map<String, String>> updateRL = new ArrayList<>();
+ Map<String, String> updateRM = new HashMap<>();
+ updateRM.put(info.getProp(), updateResult);
updateRL.add(updateRM);
result = JSONUtils.toJsonString(updateRL);
break;
@@ -490,6 +492,10 @@ public class SqlTask extends AbstractTask {
public void printReplacedSql(String content, String formatSql, String rgex, Map<Integer, Property> sqlParamsMap) {
//parameter print style
logger.info("after replace sql , preparing : {}", formatSql);
+ if (MapUtils.isEmpty(sqlParamsMap)) {
+ logger.info("sqlParamsMap should not be Empty");
+ return;
+ }
StringBuilder logPrint = new StringBuilder("replaced sql , parameters:");
if (sqlParamsMap == null) {
logger.info("printReplacedSql: sqlParamsMap is null.");
diff --git a/dolphinscheduler-server/src/main/resources/worker.properties b/dolphinscheduler-server/src/main/resources/worker.properties
index 2c37e53..59887fc 100644
--- a/dolphinscheduler-server/src/main/resources/worker.properties
+++ b/dolphinscheduler-server/src/main/resources/worker.properties
@@ -41,3 +41,11 @@
# alert server listen host
#alert.listen.host=localhost
+
+#alert.plugin.dir config the Alert Plugin dir . AlertServer while find and load the Alert Plugin Jar from this dir when deploy and start AlertServer on the server .
+#task.plugin.dir=lib/plugin/task
+
+#maven.local.repository=/Users/localRepository
+
+#task.plugin.binding config the task plugin need be load when development and run in IDE
+#task.plugin.binding=./dolphinscheduler-task-plugin/dolphinscheduler-task-shell/pom.xml
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/FormType.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/FormType.java
index 5d6234e..ad69250 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/FormType.java
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/FormType.java
@@ -22,8 +22,20 @@ import com.fasterxml.jackson.annotation.JsonValue;
public enum FormType {
INPUT("input"),
-
- RADIO("radio");
+ INPUTNUMBER("inputNumber"),
+ RADIO("radio"),
+ SELECT("select"),
+ SWITCH("switch"),
+ CHECKBOX("checkbox"),
+ TIMEPICKER("timePicker"),
+ DATEPICKER("datePicker"),
+ SLIDER("slider"),
+ RATE("rate"),
+ COLORPICKER("colorPicker"),
+ CASCADER("cascader"),
+ UPLOAD("upload"),
+ ELTRANSFER("el-transfer"),
+ TREE("tree");
private String formType;
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/ParamsProps.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/ParamsProps.java
index cab65ba..08d6844 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/ParamsProps.java
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/ParamsProps.java
@@ -26,8 +26,16 @@ public class ParamsProps {
private String placeholder;
+ /**
+ * input box size, optional value medium/small/mini
+ */
private String size = "small";
+ /**
+ * whether to disable, the default value is false
+ */
+ private Boolean disabled;
+
public void setSize(String size) {
this.size = size;
}
@@ -47,4 +55,11 @@ public class ParamsProps {
return this;
}
+ public Boolean getDisabled() {
+ return disabled;
+ }
+
+ public void setDisabled(Boolean disabled) {
+ this.disabled = disabled;
+ }
}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/PluginParams.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/PluginParams.java
index cf85781..042446a 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/PluginParams.java
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/PluginParams.java
@@ -81,12 +81,12 @@ public class PluginParams {
/**
* whether to hide, the default value is false
*/
- protected boolean hidden;
+ protected Boolean hidden;
/**
* whether to display, the default value is true
*/
- protected boolean display;
+ protected Boolean display;
protected PluginParams(Builder builder) {
@@ -132,9 +132,9 @@ public class PluginParams {
protected List<Validate> validateList;
- protected boolean hidden;
+ protected Boolean hidden;
- protected boolean display;
+ protected Boolean display;
public Builder(String name,
FormType formType,
@@ -158,8 +158,8 @@ public class PluginParams {
@JsonProperty("name") String fieldName,
@JsonProperty("validate") List<Validate> validateList,
@JsonProperty("info") String info,
- @JsonProperty("hidden") boolean hidden,
- @JsonProperty("display") boolean display
+ @JsonProperty("hidden") Boolean hidden,
+ @JsonProperty("display") Boolean display
) {
requireNonNull(name, "name is null");
requireNonNull(formType, "formType is null");
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/TaskChannel.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/ResizeType.java
similarity index 75%
copy from dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/TaskChannel.java
copy to dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/ResizeType.java
index a4cee9d..466594e 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/TaskChannel.java
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/ResizeType.java
@@ -1,4 +1,4 @@
-package org.apache.dolphinscheduler.spi.task;/*
+/*
* 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.
@@ -15,12 +15,18 @@ package org.apache.dolphinscheduler.spi.task;/*
* limitations under the License.
*/
-import org.slf4j.Logger;
+package org.apache.dolphinscheduler.spi.params.base;
-public interface TaskChannel {
+public enum ResizeType {
- void cancelApplication(boolean status);
+ NONE("none"),
+ BOTH("both"),
+ HORIZONTAL("horizontal"),
+ VERTICAL("vertical");
- AbstractTask createTask(TaskRequest taskRequest,Logger logger);
+ private String value;
+ ResizeType(String value) {
+ this.value = value;
+ }
}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/checkbox/CheckboxParam.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/checkbox/CheckboxParam.java
new file mode 100644
index 0000000..65468d3
--- /dev/null
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/checkbox/CheckboxParam.java
@@ -0,0 +1,87 @@
+package org.apache.dolphinscheduler.spi.params.checkbox;
+
+import static org.apache.dolphinscheduler.spi.params.base.FormType.CHECKBOX;
+
+import org.apache.dolphinscheduler.spi.params.base.PluginParams;
+import org.apache.dolphinscheduler.spi.params.base.Validate;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * front-end checkbox component
+ */
+public class CheckboxParam extends PluginParams {
+
+ private CheckboxParam(Builder builder) {
+ super(builder);
+ }
+
+ private CheckboxParamProps props;
+
+ public static Builder newBuilder(String name, String title) {
+ return new Builder(name, title);
+ }
+
+ public static class Builder extends PluginParams.Builder {
+
+ public Builder(String name, String title) {
+ super(name, CHECKBOX, title);
+ }
+
+ private CheckboxParamProps props;
+
+ public Builder setProps(CheckboxParamProps props) {
+ this.props = props;
+ return this;
+ }
+
+ public Builder setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Builder setTitle(String title) {
+ this.title = title;
+ return this;
+ }
+
+ public Builder setInfo(String info) {
+ this.info = info;
+ return this;
+ }
+
+ public Builder setValue(Object value) {
+ this.value = value;
+ return this;
+ }
+
+ public Builder setValidateList(List<Validate> validateList) {
+ this.validateList = validateList;
+ return this;
+ }
+
+ public Builder addValidate(Validate validate) {
+ if (this.validateList == null) {
+ this.validateList = new ArrayList<>();
+ }
+ this.validateList.add(validate);
+ return this;
+ }
+
+ public Builder setHidden(Boolean hidden) {
+ this.hidden = hidden;
+ return this;
+ }
+
+ public Builder setDisplay(Boolean display) {
+ this.display = display;
+ return this;
+ }
+ }
+
+ @Override
+ public CheckboxParamProps getProps() {
+ return props;
+ }
+}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/checkbox/CheckboxParamProps.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/checkbox/CheckboxParamProps.java
new file mode 100644
index 0000000..8d5192f
--- /dev/null
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/checkbox/CheckboxParamProps.java
@@ -0,0 +1,61 @@
+package org.apache.dolphinscheduler.spi.params.checkbox;
+
+import org.apache.dolphinscheduler.spi.params.base.ParamsProps;
+
+/**
+ * front-end checkbox component props attributes
+ */
+public class CheckboxParamProps extends ParamsProps {
+
+ /**
+ * the minimum number of checkboxes that can be checked
+ */
+ private Integer min;
+
+ /**
+ * the maximum number of checkboxes that can be checked
+ */
+ private Integer max;
+
+ /**
+ * the color of the text when the Checkbox in the form of a button is activated
+ */
+ private String textColor;
+
+ /**
+ * the fill color and border color of the Checkbox in the form of a button when activated
+ */
+ private String fill;
+
+ public Integer getMin() {
+ return min;
+ }
+
+ public void setMin(Integer min) {
+ this.min = min;
+ }
+
+ public Integer getMax() {
+ return max;
+ }
+
+ public void setMax(Integer max) {
+ this.max = max;
+ }
+
+ public String getTextColor() {
+ return textColor;
+ }
+
+ public void setTextColor(String textColor) {
+ this.textColor = textColor;
+ }
+
+ public String getFill() {
+ return fill;
+ }
+
+ public void setFill(String fill) {
+ this.fill = fill;
+ }
+}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/InputParam.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/fswitch/SwitchParam.java
similarity index 72%
copy from dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/InputParam.java
copy to dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/fswitch/SwitchParam.java
index 894d05c..b6bfe17 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/InputParam.java
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/fswitch/SwitchParam.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package org.apache.dolphinscheduler.spi.params;
+package org.apache.dolphinscheduler.spi.params.fswitch;
+
+import static org.apache.dolphinscheduler.spi.params.base.FormType.SWITCH;
-import org.apache.dolphinscheduler.spi.params.base.FormType;
-import org.apache.dolphinscheduler.spi.params.base.ParamsProps;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
@@ -26,13 +26,15 @@ import java.util.ArrayList;
import java.util.List;
/**
- * Text param
+ * front-end switch component
*/
-public class InputParam extends PluginParams {
+public class SwitchParam extends PluginParams {
- private InputParam(Builder builder) {
+ private SwitchParam(Builder builder) {
super(builder);
}
+
+ private SwitchParamProps props;
public static Builder newBuilder(String name, String title) {
return new Builder(name, title);
@@ -41,23 +43,13 @@ public class InputParam extends PluginParams {
public static class Builder extends PluginParams.Builder {
public Builder(String name, String title) {
- super(name, FormType.INPUT, title);
+ super(name, SWITCH, title);
}
- public Builder setPlaceholder(String placeholder) {
- if (this.props == null) {
- this.setProps(new ParamsProps());
- }
-
- this.props.setPlaceholder(placeholder);
- return this;
- }
+ private SwitchParamProps props;
- public Builder addValidate(Validate validate) {
- if (this.validateList == null) {
- this.validateList = new ArrayList<>();
- }
- this.validateList.add(validate);
+ public Builder setProps(SwitchParamProps props) {
+ this.props = props;
return this;
}
@@ -66,13 +58,13 @@ public class InputParam extends PluginParams {
return this;
}
- public Builder setProps(ParamsProps props) {
- this.props = props;
+ public Builder setTitle(String title) {
+ this.title = title;
return this;
}
- public Builder setTitle(String title) {
- this.title = title;
+ public Builder setInfo(String info) {
+ this.info = info;
return this;
}
@@ -86,9 +78,27 @@ public class InputParam extends PluginParams {
return this;
}
- @Override
- public InputParam build() {
- return new InputParam(this);
+ public Builder addValidate(Validate validate) {
+ if (this.validateList == null) {
+ this.validateList = new ArrayList<>();
+ }
+ this.validateList.add(validate);
+ return this;
}
+
+ public Builder setHidden(Boolean hidden) {
+ this.hidden = hidden;
+ return this;
+ }
+
+ public Builder setDisplay(Boolean display) {
+ this.display = display;
+ return this;
+ }
+ }
+
+ @Override
+ public SwitchParamProps getProps() {
+ return props;
}
}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/fswitch/SwitchParamProps.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/fswitch/SwitchParamProps.java
new file mode 100644
index 0000000..53de571
--- /dev/null
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/fswitch/SwitchParamProps.java
@@ -0,0 +1,156 @@
+/*
+ * 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.spi.params.fswitch;
+
+import org.apache.dolphinscheduler.spi.params.base.ParamsProps;
+
+/**
+ * front-end switch component props attributes
+ */
+public class SwitchParamProps extends ParamsProps {
+
+ /**
+ * the width of the switch (pixels)
+ */
+ private Integer width;
+
+ /**
+ * the class name of the icon displayed when the switch is turned on, setting this option will ignore active-text
+ */
+ private String activeIconClass;
+
+ /**
+ * the class name of the icon displayed when the switch is closed, setting this option will ignore inactive-text
+ */
+ private String inactiveIconClass;
+
+ /**
+ * text description when switch is turned on
+ */
+ private String activeText;
+
+ /**
+ * text description when switch is closed
+ */
+ private String inactiveText;
+
+ /**
+ * value when switch is turned on
+ */
+ private Object activeValue;
+
+ /**
+ * value when the switch is closed
+ */
+ private Object inactiveValue;
+
+ /**
+ * the background color when the switch is turned on
+ */
+ private String activeColor;
+
+ /**
+ * the background color when the switch is closed
+ */
+ private String inactiveColor;
+
+ /**
+ * name attribute
+ */
+ private String name;
+
+ public Integer getWidth() {
+ return width;
+ }
+
+ public void setWidth(Integer width) {
+ this.width = width;
+ }
+
+ public String getActiveIconClass() {
+ return activeIconClass;
+ }
+
+ public void setActiveIconClass(String activeIconClass) {
+ this.activeIconClass = activeIconClass;
+ }
+
+ public String getInactiveIconClass() {
+ return inactiveIconClass;
+ }
+
+ public void setInactiveIconClass(String inactiveIconClass) {
+ this.inactiveIconClass = inactiveIconClass;
+ }
+
+ public String getActiveText() {
+ return activeText;
+ }
+
+ public void setActiveText(String activeText) {
+ this.activeText = activeText;
+ }
+
+ public String getInactiveText() {
+ return inactiveText;
+ }
+
+ public void setInactiveText(String inactiveText) {
+ this.inactiveText = inactiveText;
+ }
+
+ public Object getActiveValue() {
+ return activeValue;
+ }
+
+ public void setActiveValue(Object activeValue) {
+ this.activeValue = activeValue;
+ }
+
+ public Object getInactiveValue() {
+ return inactiveValue;
+ }
+
+ public void setInactiveValue(Object inactiveValue) {
+ this.inactiveValue = inactiveValue;
+ }
+
+ public String getActiveColor() {
+ return activeColor;
+ }
+
+ public void setActiveColor(String activeColor) {
+ this.activeColor = activeColor;
+ }
+
+ public String getInactiveColor() {
+ return inactiveColor;
+ }
+
+ public void setInactiveColor(String inactiveColor) {
+ this.inactiveColor = inactiveColor;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/InputParam.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/input/InputParam.java
similarity index 75%
copy from dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/InputParam.java
copy to dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/input/InputParam.java
index 894d05c..a771f97 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/InputParam.java
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/input/InputParam.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package org.apache.dolphinscheduler.spi.params;
+package org.apache.dolphinscheduler.spi.params.input;
+
+import static org.apache.dolphinscheduler.spi.params.base.FormType.INPUT;
-import org.apache.dolphinscheduler.spi.params.base.FormType;
-import org.apache.dolphinscheduler.spi.params.base.ParamsProps;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
@@ -33,6 +33,8 @@ public class InputParam extends PluginParams {
private InputParam(Builder builder) {
super(builder);
}
+
+ private InputParamProps props;
public static Builder newBuilder(String name, String title) {
return new Builder(name, title);
@@ -41,38 +43,37 @@ public class InputParam extends PluginParams {
public static class Builder extends PluginParams.Builder {
public Builder(String name, String title) {
- super(name, FormType.INPUT, title);
+ super(name, INPUT, title);
}
+ private InputParamProps props;
+
+ public Builder setProps(InputParamProps props) {
+ this.props = props;
+ return this;
+ }
+
public Builder setPlaceholder(String placeholder) {
if (this.props == null) {
- this.setProps(new ParamsProps());
+ this.setProps(new InputParamProps());
}
this.props.setPlaceholder(placeholder);
return this;
}
- public Builder addValidate(Validate validate) {
- if (this.validateList == null) {
- this.validateList = new ArrayList<>();
- }
- this.validateList.add(validate);
- return this;
- }
-
public Builder setName(String name) {
this.name = name;
return this;
}
- public Builder setProps(ParamsProps props) {
- this.props = props;
+ public Builder setTitle(String title) {
+ this.title = title;
return this;
}
- public Builder setTitle(String title) {
- this.title = title;
+ public Builder setInfo(String info) {
+ this.info = info;
return this;
}
@@ -86,9 +87,32 @@ public class InputParam extends PluginParams {
return this;
}
+ public Builder addValidate(Validate validate) {
+ if (this.validateList == null) {
+ this.validateList = new ArrayList<>();
+ }
+ this.validateList.add(validate);
+ return this;
+ }
+
+ public Builder setHidden(Boolean hidden) {
+ this.hidden = hidden;
+ return this;
+ }
+
+ public Builder setDisplay(Boolean display) {
+ this.display = display;
+ return this;
+ }
+
@Override
public InputParam build() {
return new InputParam(this);
}
}
+
+ @Override
+ public InputParamProps getProps() {
+ return props;
+ }
}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/input/InputParamProps.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/input/InputParamProps.java
new file mode 100644
index 0000000..f352e61
--- /dev/null
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/input/InputParamProps.java
@@ -0,0 +1,297 @@
+/*
+ * 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.spi.params.input;
+
+import org.apache.dolphinscheduler.spi.params.base.ParamsProps;
+import org.apache.dolphinscheduler.spi.params.base.ResizeType;
+
+/**
+ * front-end input component props attributes
+ */
+public class InputParamProps extends ParamsProps {
+
+ /**
+ * input type
+ */
+ private String type;
+
+ /**
+ * maximum input length
+ */
+ private Integer maxlength;
+
+ /**
+ * minimum input length
+ */
+ private Integer minlength;
+
+ /**
+ * whether it can be cleared, the default value is false
+ */
+ private Boolean clearable;
+
+ /**
+ * input box head icon
+ */
+ private String prefixIcon;
+
+ /**
+ * input box end icon
+ */
+ private String suffixIcon;
+
+ /**
+ * number of lines in the input box, only valid for type="textarea"
+ */
+ private Integer rows;
+
+ /**
+ * adaptive content height, only valid for type="textarea", objects can be passed in, such as {minRows: 2, maxRows: 6}
+ */
+ private Object autosize;
+
+ /**
+ * autocomplete attribute:on, off
+ */
+ private String autocomplete;
+
+ /**
+ * name attribute
+ */
+ private String name;
+
+ /**
+ * whether it is read-only, the default value is false
+ */
+ private Boolean readonly;
+
+ /**
+ * set maximum
+ */
+ private Integer max;
+
+ /**
+ * set minimum
+ */
+ private Integer min;
+
+ /**
+ * set the legal number interval of the input field
+ */
+ private Integer step;
+
+ /**
+ * control whether it can be zoomed by the user, the value is none, both, horizontal, vertical
+ */
+ private ResizeType resize;
+
+ /**
+ * get focus automatically, the default value is false
+ */
+ private Boolean autofocus;
+
+ private String form;
+
+ /**
+ * the label text associated with the input box
+ */
+ private String label;
+
+ /**
+ * tabindex of the input box
+ */
+ private String tabindex;
+
+ /**
+ * whether to trigger the verification of the form during input, the default value is true
+ */
+ private Boolean validateEvent;
+
+ /**
+ * whether to display the switch password icon
+ */
+ private Boolean showPassword;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public Integer getMaxlength() {
+ return maxlength;
+ }
+
+ public void setMaxlength(Integer maxlength) {
+ this.maxlength = maxlength;
+ }
+
+ public Integer getMinlength() {
+ return minlength;
+ }
+
+ public void setMinlength(Integer minlength) {
+ this.minlength = minlength;
+ }
+
+ public Boolean getClearable() {
+ return clearable;
+ }
+
+ public void setClearable(Boolean clearable) {
+ this.clearable = clearable;
+ }
+
+ public String getPrefixIcon() {
+ return prefixIcon;
+ }
+
+ public void setPrefixIcon(String prefixIcon) {
+ this.prefixIcon = prefixIcon;
+ }
+
+ public String getSuffixIcon() {
+ return suffixIcon;
+ }
+
+ public void setSuffixIcon(String suffixIcon) {
+ this.suffixIcon = suffixIcon;
+ }
+
+ public Integer getRows() {
+ return rows;
+ }
+
+ public void setRows(Integer rows) {
+ this.rows = rows;
+ }
+
+ public Object getAutosize() {
+ return autosize;
+ }
+
+ public void setAutosize(Object autosize) {
+ this.autosize = autosize;
+ }
+
+ public String getAutocomplete() {
+ return autocomplete;
+ }
+
+ public void setAutocomplete(String autocomplete) {
+ this.autocomplete = autocomplete;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Boolean getReadonly() {
+ return readonly;
+ }
+
+ public void setReadonly(Boolean readonly) {
+ this.readonly = readonly;
+ }
+
+ public Integer getMax() {
+ return max;
+ }
+
+ public void setMax(Integer max) {
+ this.max = max;
+ }
+
+ public Integer getMin() {
+ return min;
+ }
+
+ public void setMin(Integer min) {
+ this.min = min;
+ }
+
+ public Integer getStep() {
+ return step;
+ }
+
+ public void setStep(Integer step) {
+ this.step = step;
+ }
+
+ public ResizeType getResize() {
+ return resize;
+ }
+
+ public void setResize(ResizeType resize) {
+ this.resize = resize;
+ }
+
+ public Boolean getAutofocus() {
+ return autofocus;
+ }
+
+ public void setAutofocus(Boolean autofocus) {
+ this.autofocus = autofocus;
+ }
+
+ public String getForm() {
+ return form;
+ }
+
+ public void setForm(String form) {
+ this.form = form;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public String getTabindex() {
+ return tabindex;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public Boolean getValidateEvent() {
+ return validateEvent;
+ }
+
+ public void setValidateEvent(Boolean validateEvent) {
+ this.validateEvent = validateEvent;
+ }
+
+ public Boolean getShowPassword() {
+ return showPassword;
+ }
+
+ public void setShowPassword(Boolean showPassword) {
+ this.showPassword = showPassword;
+ }
+}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/InputParam.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/inputNumber/InputNumberParam.java
similarity index 70%
rename from dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/InputParam.java
rename to dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/inputNumber/InputNumberParam.java
index 894d05c..71c905b 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/InputParam.java
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/inputNumber/InputNumberParam.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package org.apache.dolphinscheduler.spi.params;
+package org.apache.dolphinscheduler.spi.params.inputNumber;
+
+import static org.apache.dolphinscheduler.spi.params.base.FormType.INPUTNUMBER;
-import org.apache.dolphinscheduler.spi.params.base.FormType;
-import org.apache.dolphinscheduler.spi.params.base.ParamsProps;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
@@ -26,14 +26,16 @@ import java.util.ArrayList;
import java.util.List;
/**
- * Text param
+ * front-end input number component
*/
-public class InputParam extends PluginParams {
+public class InputNumberParam extends PluginParams {
- private InputParam(Builder builder) {
+ private InputNumberParam(Builder builder) {
super(builder);
}
+ private InputNumberParamProps props;
+
public static Builder newBuilder(String name, String title) {
return new Builder(name, title);
}
@@ -41,23 +43,13 @@ public class InputParam extends PluginParams {
public static class Builder extends PluginParams.Builder {
public Builder(String name, String title) {
- super(name, FormType.INPUT, title);
+ super(name, INPUTNUMBER, title);
}
- public Builder setPlaceholder(String placeholder) {
- if (this.props == null) {
- this.setProps(new ParamsProps());
- }
-
- this.props.setPlaceholder(placeholder);
- return this;
- }
+ private InputNumberParamProps props;
- public Builder addValidate(Validate validate) {
- if (this.validateList == null) {
- this.validateList = new ArrayList<>();
- }
- this.validateList.add(validate);
+ public Builder setProps(InputNumberParamProps props) {
+ this.props = props;
return this;
}
@@ -66,13 +58,13 @@ public class InputParam extends PluginParams {
return this;
}
- public Builder setProps(ParamsProps props) {
- this.props = props;
+ public Builder setTitle(String title) {
+ this.title = title;
return this;
}
- public Builder setTitle(String title) {
- this.title = title;
+ public Builder setInfo(String info) {
+ this.info = info;
return this;
}
@@ -86,9 +78,27 @@ public class InputParam extends PluginParams {
return this;
}
- @Override
- public InputParam build() {
- return new InputParam(this);
+ public Builder addValidate(Validate validate) {
+ if (this.validateList == null) {
+ this.validateList = new ArrayList<>();
+ }
+ this.validateList.add(validate);
+ return this;
}
+
+ public Builder setHidden(Boolean hidden) {
+ this.hidden = hidden;
+ return this;
+ }
+
+ public Builder setDisplay(Boolean display) {
+ this.display = display;
+ return this;
+ }
+ }
+
+ @Override
+ public InputNumberParamProps getProps() {
+ return props;
}
}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/inputNumber/InputNumberParamProps.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/inputNumber/InputNumberParamProps.java
new file mode 100644
index 0000000..dbb469e
--- /dev/null
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/inputNumber/InputNumberParamProps.java
@@ -0,0 +1,130 @@
+/*
+ * 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.spi.params.inputNumber;
+
+import org.apache.dolphinscheduler.spi.params.base.ParamsProps;
+
+/**
+ * front-end input number component props attributes
+ */
+public class InputNumberParamProps extends ParamsProps {
+
+ /**
+ * set the minimum value allowed by the counter
+ */
+ private Integer min;
+
+ /**
+ * set the maximum value allowed by the counter
+ */
+ private Integer max;
+
+ /**
+ * counter step
+ */
+ private Integer step;
+
+ /**
+ * numerical accuracy
+ */
+ private Integer precision;
+
+ /**
+ * whether to use the control button, the default value is true
+ */
+ private Boolean controls;
+
+ /**
+ * control button position, the default value is right
+ */
+ private String controlsPosition;
+
+ /**
+ * name attribute
+ */
+ private String name;
+
+ /**
+ * the label text associated with the input box
+ */
+ private String label;
+
+ public Integer getMin() {
+ return min;
+ }
+
+ public void setMin(Integer min) {
+ this.min = min;
+ }
+
+ public Integer getMax() {
+ return max;
+ }
+
+ public void setMax(Integer max) {
+ this.max = max;
+ }
+
+ public Integer getStep() {
+ return step;
+ }
+
+ public void setStep(Integer step) {
+ this.step = step;
+ }
+
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public void setPrecision(Integer precision) {
+ this.precision = precision;
+ }
+
+ public Boolean getControls() {
+ return controls;
+ }
+
+ public void setControls(Boolean controls) {
+ this.controls = controls;
+ }
+
+ public String getControlsPosition() {
+ return controlsPosition;
+ }
+
+ public void setControlsPosition(String controlsPosition) {
+ this.controlsPosition = controlsPosition;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/RadioParam.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/radio/RadioParam.java
similarity index 67%
copy from dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/RadioParam.java
copy to dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/radio/RadioParam.java
index 70e0b5c..8d4411a 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/RadioParam.java
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/radio/RadioParam.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.dolphinscheduler.spi.params;
+package org.apache.dolphinscheduler.spi.params.radio;
+import static org.apache.dolphinscheduler.spi.params.base.FormType.RADIO;
import static org.apache.dolphinscheduler.spi.utils.Constants.STRING_PLUGIN_PARAM_OPTIONS;
-import org.apache.dolphinscheduler.spi.params.base.FormType;
import org.apache.dolphinscheduler.spi.params.base.ParamsOptions;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
@@ -30,16 +30,18 @@ import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
- * radio
+ * front-end radio select component
*/
public class RadioParam extends PluginParams {
@JsonProperty(STRING_PLUGIN_PARAM_OPTIONS)
- private List<ParamsOptions> paramsOptionsList;
+ private List<ParamsOptions> options;
+
+ private RadioParamProps props;
private RadioParam(Builder builder) {
super(builder);
- this.paramsOptionsList = builder.paramsOptionsList;
+ this.options = builder.options;
}
public static Builder newBuilder(String name, String title) {
@@ -48,17 +50,30 @@ public class RadioParam extends PluginParams {
public static class Builder extends PluginParams.Builder {
- private List<ParamsOptions> paramsOptionsList;
-
public Builder(String name, String title) {
- super(name, FormType.RADIO, title);
+ super(name, RADIO, title);
}
+
+ private List<ParamsOptions> options;
- public Builder addValidate(Validate validate) {
- if (this.validateList == null) {
- this.validateList = new ArrayList<>();
+ private RadioParamProps props;
+
+ public Builder setOptions(List<ParamsOptions> options) {
+ this.options = options;
+ return this;
+ }
+
+ public Builder addParamsOptions(ParamsOptions paramsOptions) {
+ if (this.options == null) {
+ this.options = new ArrayList<>();
}
- this.validateList.add(validate);
+
+ this.options.add(paramsOptions);
+ return this;
+ }
+
+ public Builder setProps(RadioParamProps props) {
+ this.props = props;
return this;
}
@@ -72,6 +87,11 @@ public class RadioParam extends PluginParams {
return this;
}
+ public Builder setInfo(String info) {
+ this.info = info;
+ return this;
+ }
+
public Builder setValue(Object value) {
this.value = value;
return this;
@@ -82,17 +102,21 @@ public class RadioParam extends PluginParams {
return this;
}
- public Builder setParamsOptionsList(List<ParamsOptions> paramsOptionsList) {
- this.paramsOptionsList = paramsOptionsList;
+ public Builder addValidate(Validate validate) {
+ if (this.validateList == null) {
+ this.validateList = new ArrayList<>();
+ }
+ this.validateList.add(validate);
return this;
}
- public Builder addParamsOptions(ParamsOptions paramsOptions) {
- if (this.paramsOptionsList == null) {
- this.paramsOptionsList = new ArrayList<>();
- }
+ public Builder setHidden(Boolean hidden) {
+ this.hidden = hidden;
+ return this;
+ }
- this.paramsOptionsList.add(paramsOptions);
+ public Builder setDisplay(Boolean display) {
+ this.display = display;
return this;
}
@@ -102,7 +126,12 @@ public class RadioParam extends PluginParams {
}
}
- public List<ParamsOptions> getParamsOptionsList() {
- return paramsOptionsList;
+ public List<ParamsOptions> getOptions() {
+ return options;
+ }
+
+ @Override
+ public RadioParamProps getProps() {
+ return props;
}
}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/ParamsProps.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/radio/RadioParamProps.java
similarity index 53%
copy from dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/ParamsProps.java
copy to dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/radio/RadioParamProps.java
index cab65ba..f558f75 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/base/ParamsProps.java
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/radio/RadioParamProps.java
@@ -15,36 +15,38 @@
* limitations under the License.
*/
-package org.apache.dolphinscheduler.spi.params.base;
+package org.apache.dolphinscheduler.spi.params.radio;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.dolphinscheduler.spi.params.base.ParamsProps;
/**
- * the props field in form-create`s json rule
+ * front-end radio component props attributes
*/
-public class ParamsProps {
+public class RadioParamProps extends ParamsProps {
- private String placeholder;
+ /**
+ * the color of the text when Radio is activated in the form of a button
+ */
+ private String textColor;
- private String size = "small";
+ /**
+ * the fill color and border color of the button form of Radio when activated
+ */
+ private String fill;
- public void setSize(String size) {
- this.size = size;
+ public String getTextColor() {
+ return textColor;
}
- @JsonProperty("size")
- public String getSize() {
- return size;
+ public void setTextColor(String textColor) {
+ this.textColor = textColor;
}
- @JsonProperty("placeholder")
- public String getPlaceholder() {
- return placeholder;
+ public String getFill() {
+ return fill;
}
- public ParamsProps setPlaceholder(String placeholder) {
- this.placeholder = placeholder;
- return this;
+ public void setFill(String fill) {
+ this.fill = fill;
}
-
}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/RadioParam.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/select/SelectParam.java
similarity index 61%
rename from dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/RadioParam.java
rename to dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/select/SelectParam.java
index 70e0b5c..7ac2758 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/RadioParam.java
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/select/SelectParam.java
@@ -15,11 +15,10 @@
* limitations under the License.
*/
-package org.apache.dolphinscheduler.spi.params;
+package org.apache.dolphinscheduler.spi.params.select;
-import static org.apache.dolphinscheduler.spi.utils.Constants.STRING_PLUGIN_PARAM_OPTIONS;
+import static org.apache.dolphinscheduler.spi.params.base.FormType.SELECT;
-import org.apache.dolphinscheduler.spi.params.base.FormType;
import org.apache.dolphinscheduler.spi.params.base.ParamsOptions;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
import org.apache.dolphinscheduler.spi.params.base.Validate;
@@ -27,19 +26,17 @@ import org.apache.dolphinscheduler.spi.params.base.Validate;
import java.util.ArrayList;
import java.util.List;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
/**
- * radio
+ * front-end select component
*/
-public class RadioParam extends PluginParams {
+public class SelectParam extends PluginParams {
+
+ private List<ParamsOptions> options;
- @JsonProperty(STRING_PLUGIN_PARAM_OPTIONS)
- private List<ParamsOptions> paramsOptionsList;
+ private SelectParamProps props;
- private RadioParam(Builder builder) {
+ private SelectParam(Builder builder) {
super(builder);
- this.paramsOptionsList = builder.paramsOptionsList;
}
public static Builder newBuilder(String name, String title) {
@@ -48,17 +45,30 @@ public class RadioParam extends PluginParams {
public static class Builder extends PluginParams.Builder {
- private List<ParamsOptions> paramsOptionsList;
-
public Builder(String name, String title) {
- super(name, FormType.RADIO, title);
+ super(name, SELECT, title);
}
- public Builder addValidate(Validate validate) {
- if (this.validateList == null) {
- this.validateList = new ArrayList<>();
+ private List<ParamsOptions> options;
+
+ private SelectParamProps props;
+
+ public Builder setOptions(List<ParamsOptions> options) {
+ this.options = options;
+ return this;
+ }
+
+ public Builder addOptions(ParamsOptions paramsOptions) {
+ if (this.options == null) {
+ this.options = new ArrayList<>();
}
- this.validateList.add(validate);
+
+ this.options.add(paramsOptions);
+ return this;
+ }
+
+ public Builder setProps(SelectParamProps props) {
+ this.props = props;
return this;
}
@@ -72,6 +82,11 @@ public class RadioParam extends PluginParams {
return this;
}
+ public Builder setInfo(String info) {
+ this.info = info;
+ return this;
+ }
+
public Builder setValue(Object value) {
this.value = value;
return this;
@@ -82,27 +97,31 @@ public class RadioParam extends PluginParams {
return this;
}
- public Builder setParamsOptionsList(List<ParamsOptions> paramsOptionsList) {
- this.paramsOptionsList = paramsOptionsList;
+ public Builder addValidate(Validate validate) {
+ if (this.validateList == null) {
+ this.validateList = new ArrayList<>();
+ }
+ this.validateList.add(validate);
return this;
}
- public Builder addParamsOptions(ParamsOptions paramsOptions) {
- if (this.paramsOptionsList == null) {
- this.paramsOptionsList = new ArrayList<>();
- }
-
- this.paramsOptionsList.add(paramsOptions);
+ public Builder setHidden(Boolean hidden) {
+ this.hidden = hidden;
return this;
}
- @Override
- public RadioParam build() {
- return new RadioParam(this);
+ public Builder setDisplay(Boolean display) {
+ this.display = display;
+ return this;
}
}
- public List<ParamsOptions> getParamsOptionsList() {
- return paramsOptionsList;
+ public List<ParamsOptions> getOptions() {
+ return options;
+ }
+
+ @Override
+ public SelectParamProps getProps() {
+ return props;
}
}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/select/SelectParamProps.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/select/SelectParamProps.java
new file mode 100644
index 0000000..a8a68ee
--- /dev/null
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/params/select/SelectParamProps.java
@@ -0,0 +1,239 @@
+/*
+ * 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.spi.params.select;
+
+import org.apache.dolphinscheduler.spi.params.base.ParamsProps;
+
+/**
+ * front-end select component props attributes
+ */
+public class SelectParamProps extends ParamsProps {
+
+ /**
+ * whether to select multiple, the default value is false
+ */
+ private Boolean multiple;
+
+ /**
+ * as the key name that uniquely identifies the value, it is required when the binding value is the object type
+ */
+ private String valueKey;
+
+ /**
+ * input box size, optional value medium/small/mini
+ */
+ private String size;
+
+ /**
+ * whether the option can be cleared, the default value is false
+ */
+ private Boolean clearable;
+
+ /**
+ * whether to display the selected value in the form of text when multiple selections, the default value is false
+ */
+ private Boolean collapseTags;
+
+ /**
+ * the maximum number of items that the user can select when multiple selections are made, if it is 0, there is no limit
+ */
+ private Integer multipleLimit;
+
+ /**
+ * select input name attribute
+ */
+ private String name;
+
+ /**
+ * select input autocomplete attribute, the default value is off
+ */
+ private String autocomplete;
+
+ /**
+ * whether it is searchable, the default value is false
+ */
+ private Boolean filterable;
+
+ /**
+ * whether to allow users to create new entries, it needs to be used with filterable, the default value is false
+ */
+ private Boolean allowCreate;
+
+ /**
+ * the text displayed when there is no match for the search criteria
+ */
+ private String noMatchText;
+
+ /**
+ * the text displayed when the option is empty
+ */
+ private String noDataText;
+
+ /**
+ * Select the class name of the drop-down box
+ */
+ private String popperClass;
+
+ /**
+ * when multiple selection and searchable, whether to keep the current search keywords after selecting an option, the default value is false
+ */
+ private Boolean reserveKeyword;
+
+ /**
+ * press Enter in the input box to select the first match. need to be used with filterable or remote, the default value is false
+ */
+ private Boolean defaultFirstOption;
+
+ /**
+ * whether to insert a pop-up box into the body element. when there is a problem with the positioning of the pop-up box, this property can be set to false
+ */
+ private Boolean popperAppendToBody;
+
+ /**
+ * for non-searchable Select, whether to automatically pop up the option menu after the input box gets the focus, the default value is false
+ */
+ private Boolean automaticDropdown;
+
+ public Boolean getMultiple() {
+ return multiple;
+ }
+
+ public void setMultiple(Boolean multiple) {
+ this.multiple = multiple;
+ }
+
+ public String getValueKey() {
+ return valueKey;
+ }
+
+ public void setValueKey(String valueKey) {
+ this.valueKey = valueKey;
+ }
+
+ public Boolean getClearable() {
+ return clearable;
+ }
+
+ public void setClearable(Boolean clearable) {
+ this.clearable = clearable;
+ }
+
+ public Boolean getCollapseTags() {
+ return collapseTags;
+ }
+
+ public void setCollapseTags(Boolean collapseTags) {
+ this.collapseTags = collapseTags;
+ }
+
+ public Integer getMultipleLimit() {
+ return multipleLimit;
+ }
+
+ public void setMultipleLimit(Integer multipleLimit) {
+ this.multipleLimit = multipleLimit;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getAutocomplete() {
+ return autocomplete;
+ }
+
+ public void setAutocomplete(String autocomplete) {
+ this.autocomplete = autocomplete;
+ }
+
+ public Boolean getFilterable() {
+ return filterable;
+ }
+
+ public void setFilterable(Boolean filterable) {
+ this.filterable = filterable;
+ }
+
+ public Boolean getAllowCreate() {
+ return allowCreate;
+ }
+
+ public void setAllowCreate(Boolean allowCreate) {
+ this.allowCreate = allowCreate;
+ }
+
+ public String getNoMatchText() {
+ return noMatchText;
+ }
+
+ public void setNoMatchText(String noMatchText) {
+ this.noMatchText = noMatchText;
+ }
+
+ public String getNoDataText() {
+ return noDataText;
+ }
+
+ public void setNoDataText(String noDataText) {
+ this.noDataText = noDataText;
+ }
+
+ public String getPopperClass() {
+ return popperClass;
+ }
+
+ public void setPopperClass(String popperClass) {
+ this.popperClass = popperClass;
+ }
+
+ public Boolean getReserveKeyword() {
+ return reserveKeyword;
+ }
+
+ public void setReserveKeyword(Boolean reserveKeyword) {
+ this.reserveKeyword = reserveKeyword;
+ }
+
+ public Boolean getDefaultFirstOption() {
+ return defaultFirstOption;
+ }
+
+ public void setDefaultFirstOption(Boolean defaultFirstOption) {
+ this.defaultFirstOption = defaultFirstOption;
+ }
+
+ public Boolean getPopperAppendToBody() {
+ return popperAppendToBody;
+ }
+
+ public void setPopperAppendToBody(Boolean popperAppendToBody) {
+ this.popperAppendToBody = popperAppendToBody;
+ }
+
+ public Boolean getAutomaticDropdown() {
+ return automaticDropdown;
+ }
+
+ public void setAutomaticDropdown(Boolean automaticDropdown) {
+ this.automaticDropdown = automaticDropdown;
+ }
+}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/TaskChannel.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/TaskChannel.java
index a4cee9d..5a3a524 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/TaskChannel.java
+++ b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/TaskChannel.java
@@ -21,6 +21,6 @@ public interface TaskChannel {
void cancelApplication(boolean status);
- AbstractTask createTask(TaskRequest taskRequest,Logger logger);
+ AbstractTask createTask(TaskRequest taskRequest, Logger logger);
}
diff --git a/dolphinscheduler-spi/src/test/java/org/apache/dolphinscheduler/spi/params/PluginParamsTransferTest.java b/dolphinscheduler-spi/src/test/java/org/apache/dolphinscheduler/spi/params/PluginParamsTransferTest.java
index a4d93d6..48a60d0 100644
--- a/dolphinscheduler-spi/src/test/java/org/apache/dolphinscheduler/spi/params/PluginParamsTransferTest.java
+++ b/dolphinscheduler-spi/src/test/java/org/apache/dolphinscheduler/spi/params/PluginParamsTransferTest.java
@@ -25,6 +25,8 @@ import org.apache.dolphinscheduler.spi.params.base.Validate;
import java.util.ArrayList;
import java.util.List;
+import org.apache.dolphinscheduler.spi.params.input.InputParam;
+import org.apache.dolphinscheduler.spi.params.radio.RadioParam;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -110,7 +112,7 @@ public class PluginParamsTransferTest {
emailShowTypeList.add(new ParamsOptions("attachment", "attachment", false));
emailShowTypeList.add(new ParamsOptions("tableattachment", "tableattachment", false));
RadioParam showType = new RadioParam.Builder("showType", "showType")
- .setParamsOptionsList(emailShowTypeList)
+ .setOptions(emailShowTypeList)
.setValue("table")
.addValidate(Validate.newBuilder().setRequired(true).build())
.build();
diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/pom.xml b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/pom.xml
index 01fb97f..75f87cb 100644
--- a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/pom.xml
+++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/pom.xml
@@ -42,12 +42,13 @@
<artifactId>guava</artifactId>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-flink/pom.xml b/dolphinscheduler-task-plugin/dolphinscheduler-task-flink/pom.xml
index ae261a4..94d280b 100644
--- a/dolphinscheduler-task-plugin/dolphinscheduler-task-flink/pom.xml
+++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-flink/pom.xml
@@ -37,6 +37,11 @@
<artifactId>dolphinscheduler-task-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-python/pom.xml b/dolphinscheduler-task-plugin/dolphinscheduler-task-python/pom.xml
index 2d620af..fa11c52 100644
--- a/dolphinscheduler-task-plugin/dolphinscheduler-task-python/pom.xml
+++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-python/pom.xml
@@ -38,6 +38,12 @@
<artifactId>dolphinscheduler-task-api</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-shell/pom.xml b/dolphinscheduler-task-plugin/dolphinscheduler-task-shell/pom.xml
index abf1974..a753e90 100644
--- a/dolphinscheduler-task-plugin/dolphinscheduler-task-shell/pom.xml
+++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-shell/pom.xml
@@ -26,6 +26,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dolphinscheduler-task-shell</artifactId>
+ <packaging>dolphinscheduler-plugin</packaging>
<dependencies>
<dependency>
@@ -38,9 +39,9 @@
<artifactId>dolphinscheduler-task-api</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
</dependencies>
+
+ <build>
+ <finalName>dolphinscheduler-task-shell-${project.version}</finalName>
+ </build>
</project>
\ No newline at end of file
diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-shell/src/main/java/org/apache/dolphinscheduler/plugin/task/shell/ShellTaskChannelFactory.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-shell/src/main/java/org/apache/dolphinscheduler/plugin/task/shell/ShellTaskChannelFactory.java
index fd154e4..63f283a 100644
--- a/dolphinscheduler-task-plugin/dolphinscheduler-task-shell/src/main/java/org/apache/dolphinscheduler/plugin/task/shell/ShellTaskChannelFactory.java
+++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-shell/src/main/java/org/apache/dolphinscheduler/plugin/task/shell/ShellTaskChannelFactory.java
@@ -17,10 +17,15 @@
package org.apache.dolphinscheduler.plugin.task.shell;
+import org.apache.dolphinscheduler.spi.params.input.InputParam;
+import org.apache.dolphinscheduler.spi.params.base.ParamsOptions;
import org.apache.dolphinscheduler.spi.params.base.PluginParams;
+import org.apache.dolphinscheduler.spi.params.base.Validate;
+import org.apache.dolphinscheduler.spi.params.radio.RadioParam;
import org.apache.dolphinscheduler.spi.task.TaskChannel;
import org.apache.dolphinscheduler.spi.task.TaskChannelFactory;
+import java.util.ArrayList;
import java.util.List;
public class ShellTaskChannelFactory implements TaskChannelFactory {
@@ -31,11 +36,26 @@ public class ShellTaskChannelFactory implements TaskChannelFactory {
@Override
public String getName() {
- return "Shell";
+ return "SHELL";
}
@Override
public List<PluginParams> getParams() {
- return null;
+ List<PluginParams> paramsList = new ArrayList<>();
+
+ InputParam nodeName = InputParam.newBuilder("name", "$t('Node name')")
+ .addValidate(Validate.newBuilder()
+ .setRequired(true)
+ .build())
+ .build();
+
+ RadioParam runFlag = RadioParam.newBuilder("runFlag", "运行标志")
+ .addParamsOptions(new ParamsOptions("NORMAL", "NORMAL", false))
+ .addParamsOptions(new ParamsOptions("FORBIDDEN", "FORBIDDEN", false))
+ .build();
+
+ paramsList.add(nodeName);
+ paramsList.add(runFlag);
+ return paramsList;
}
}
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/TaskChannel.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-shell/src/main/java/org/apache/dolphinscheduler/plugin/task/shell/ShellTaskConstants.java
similarity index 78%
copy from dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/TaskChannel.java
copy to dolphinscheduler-task-plugin/dolphinscheduler-task-shell/src/main/java/org/apache/dolphinscheduler/plugin/task/shell/ShellTaskConstants.java
index a4cee9d..95fe00b 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/TaskChannel.java
+++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-shell/src/main/java/org/apache/dolphinscheduler/plugin/task/shell/ShellTaskConstants.java
@@ -1,4 +1,4 @@
-package org.apache.dolphinscheduler.spi.task;/*
+/*
* 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.
@@ -15,12 +15,11 @@ package org.apache.dolphinscheduler.spi.task;/*
* limitations under the License.
*/
-import org.slf4j.Logger;
+package org.apache.dolphinscheduler.plugin.task.shell;
-public interface TaskChannel {
+public class ShellTaskConstants {
- void cancelApplication(boolean status);
-
- AbstractTask createTask(TaskRequest taskRequest,Logger logger);
+ private ShellTaskConstants() {
+ }
}
diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-spark/pom.xml b/dolphinscheduler-task-plugin/dolphinscheduler-task-spark/pom.xml
index 7245c35..51b4cb4 100644
--- a/dolphinscheduler-task-plugin/dolphinscheduler-task-spark/pom.xml
+++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-spark/pom.xml
@@ -36,6 +36,12 @@
<artifactId>dolphinscheduler-task-api</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 37524d1..522d9b1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,7 +97,7 @@
<mssql.jdbc.version>6.1.0.jre8</mssql.jdbc.version>
<presto.jdbc.version>0.238.1</presto.jdbc.version>
<spotbugs.version>3.1.12</spotbugs.version>
- <checkstyle.version>3.0.0</checkstyle.version>
+ <checkstyle.version>3.1.2</checkstyle.version>
<zookeeper.version>3.4.14</zookeeper.version>
<curator.test>2.12.0</curator.test>
<frontend-maven-plugin.version>1.6</frontend-maven-plugin.version>
@@ -208,6 +208,11 @@
</dependency>
<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
+ <artifactId>dolphinscheduler-standalone-server</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-common</artifactId>
<version>${project.version}</version>
</dependency>
@@ -310,7 +315,6 @@
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
<version>${curator.test}</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
@@ -661,7 +665,6 @@
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>
</dependency>
-
</dependencies>
</dependencyManagement>
@@ -899,7 +902,6 @@
<include>**/api/utils/ResultTest.java</include>
<include>**/common/graph/DAGTest.java</include>
<include>**/common/os/OshiTest.java</include>
- <include>**/common/os/OSUtilsTest.java</include>
<include>**/common/shell/ShellExecutorTest.java</include>
<include>**/common/task/DataxParametersTest.java</include>
<include>**/common/task/EntityTestUtils.java</include>
@@ -919,7 +921,6 @@
<include>**/common/utils/JSONUtilsTest.java</include>
<include>**/common/utils/LoggerUtilsTest.java</include>
<include>**/common/utils/NetUtilsTest.java</include>
- <include>**/common/utils/OSUtilsTest.java</include>
<include>**/common/utils/ParameterUtilsTest.java</include>
<include>**/common/utils/TimePlaceholderUtilsTest.java</include>
<include>**/common/utils/PreconditionsTest.java</include>
@@ -991,6 +992,7 @@
<include>**/server/master/MasterCommandTest.java</include>
<include>**/server/master/DependentTaskTest.java</include>
<include>**/server/master/ConditionsTaskTest.java</include>
+ <include>**/server/master/SwitchTaskTest.java</include>
<include>**/server/master/MasterExecThreadTest.java</include>
<include>**/server/master/ParamsTest.java</include>
<include>**/server/master/SubProcessTaskTest.java</include>
@@ -1065,7 +1067,6 @@
<include>**/plugin/alert/email/EmailAlertChannelFactoryTest.java</include>
<include>**/plugin/alert/email/EmailAlertChannelTest.java</include>
<include>**/plugin/alert/email/ExcelUtilsTest.java</include>
- <include>**/plugin/alert/email/MailUtilsTest.java</include>
<include>**/plugin/alert/email/template/DefaultHTMLTemplateTest.java</include>
<include>**/plugin/alert/dingtalk/DingTalkSenderTest.java</include>
<include>**/plugin/alert/dingtalk/DingTalkAlertChannelFactoryTest.java</include>
@@ -1153,15 +1154,13 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
- <version>8.18</version>
+ <version>8.45</version>
</dependency>
</dependencies>
<configuration>
<consoleOutput>true</consoleOutput>
<encoding>UTF-8</encoding>
<configLocation>style/checkstyle.xml</configLocation>
- <suppressionsLocation>style/checkstyle-suppressions.xml</suppressionsLocation>
- <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
<failOnViolation>true</failOnViolation>
<violationSeverity>warning</violationSeverity>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
@@ -1169,7 +1168,6 @@
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
</sourceDirectories>
<excludes>**\/generated-sources\/</excludes>
- <skip>true</skip>
</configuration>
<executions>
<execution>
@@ -1215,5 +1213,6 @@
<module>dolphinscheduler-remote</module>
<module>dolphinscheduler-service</module>
<module>dolphinscheduler-microbench</module>
+ <module>dolphinscheduler-standalone-server</module>
</modules>
</project>