From 838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80 Mon Sep 17 00:00:00 2001 From: Wenjun Ruan Date: Tue, 13 Dec 2022 16:30:44 +0800 Subject: [PATCH] Remove logic task plugin module (#13171) --- .../service/task/TaskPluginManager.java | 28 ++++- .../dolphinscheduler-task-all/pom.xml | 29 ----- .../dolphinscheduler-task-blocking/pom.xml | 43 -------- .../task/blocking/BlockingTaskChannel.java | 50 --------- .../blocking/BlockingTaskChannelFactory.java | 47 -------- .../dolphinscheduler-task-conditions/pom.xml | 43 -------- .../conditions/ConditionsTaskChannel.java | 50 --------- .../ConditionsTaskChannelFactory.java | 67 ----------- .../dolphinscheduler-task-dependent/pom.xml | 43 -------- .../task/dependent/DependentTaskChannel.java | 54 --------- .../DependentTaskChannelFactory.java | 47 -------- .../dolphinscheduler-task-subprocess/pom.xml | 43 -------- .../subprocess/SubProcessTaskChannel.java | 50 --------- .../SubProcessTaskChannelFactory.java | 47 -------- .../dolphinscheduler-task-switch/pom.xml | 43 -------- .../task/switchtask/SwitchCondition.java | 40 ------- .../task/switchtask/SwitchParameters.java | 104 ------------------ .../plugin/task/switchtask/SwitchResult.java | 43 -------- .../task/switchtask/SwitchTaskChannel.java | 49 --------- .../switchtask/SwitchTaskChannelFactory.java | 46 -------- dolphinscheduler-task-plugin/pom.xml | 5 - 21 files changed, 24 insertions(+), 947 deletions(-) delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-blocking/pom.xml delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-blocking/src/main/java/org/apache/dolphinscheduler/plugin/task/blocking/BlockingTaskChannel.java delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-blocking/src/main/java/org/apache/dolphinscheduler/plugin/task/blocking/BlockingTaskChannelFactory.java delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-conditions/pom.xml delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-conditions/src/main/java/org/apache/dolphinscheduler/plugin/task/conditions/ConditionsTaskChannel.java delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-conditions/src/main/java/org/apache/dolphinscheduler/plugin/task/conditions/ConditionsTaskChannelFactory.java delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-dependent/pom.xml delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-dependent/src/main/java/org/apache/dolphinscheduler/plugin/task/dependent/DependentTaskChannel.java delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-dependent/src/main/java/org/apache/dolphinscheduler/plugin/task/dependent/DependentTaskChannelFactory.java delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-subprocess/pom.xml delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-subprocess/src/main/java/org/apache/dolphinscheduler/plugin/task/subprocess/SubProcessTaskChannel.java delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-subprocess/src/main/java/org/apache/dolphinscheduler/plugin/task/subprocess/SubProcessTaskChannelFactory.java delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-switch/pom.xml delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchCondition.java delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchParameters.java delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchResult.java delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchTaskChannel.java delete mode 100644 dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchTaskChannelFactory.java diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/task/TaskPluginManager.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/task/TaskPluginManager.java index 6bcd079870..d7e35c3f28 100644 --- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/task/TaskPluginManager.java +++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/task/TaskPluginManager.java @@ -17,10 +17,17 @@ package org.apache.dolphinscheduler.service.task; +import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; import org.apache.dolphinscheduler.plugin.task.api.TaskChannelFactory; +import org.apache.dolphinscheduler.plugin.task.api.TaskConstants; import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; +import org.apache.dolphinscheduler.plugin.task.api.parameters.BlockingParameters; +import org.apache.dolphinscheduler.plugin.task.api.parameters.ConditionsParameters; +import org.apache.dolphinscheduler.plugin.task.api.parameters.DependentParameters; import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode; +import org.apache.dolphinscheduler.plugin.task.api.parameters.SubProcessParameters; +import org.apache.dolphinscheduler.plugin.task.api.parameters.SwitchParameters; import org.apache.dolphinscheduler.spi.plugin.PrioritySPIFactory; import java.util.Collections; @@ -88,11 +95,24 @@ public class TaskPluginManager { if (Objects.isNull(taskType)) { return null; } - TaskChannel taskChannel = this.getTaskChannelMap().get(taskType); - if (Objects.isNull(taskChannel)) { - return null; + switch (taskType) { + case TaskConstants.TASK_TYPE_CONDITIONS: + return JSONUtils.parseObject(parametersNode.getTaskParams(), ConditionsParameters.class); + case TaskConstants.TASK_TYPE_SWITCH: + return JSONUtils.parseObject(parametersNode.getTaskParams(), SwitchParameters.class); + case TaskConstants.TASK_TYPE_SUB_PROCESS: + return JSONUtils.parseObject(parametersNode.getTaskParams(), SubProcessParameters.class); + case TaskConstants.TASK_TYPE_DEPENDENT: + return JSONUtils.parseObject(parametersNode.getTaskParams(), DependentParameters.class); + case TaskConstants.TASK_TYPE_BLOCKING: + return JSONUtils.parseObject(parametersNode.getTaskParams(), BlockingParameters.class); + default: + TaskChannel taskChannel = this.getTaskChannelMap().get(taskType); + if (Objects.isNull(taskChannel)) { + return null; + } + return taskChannel.parseParameters(parametersNode); } - return taskChannel.parseParameters(parametersNode); } } diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-all/pom.xml b/dolphinscheduler-task-plugin/dolphinscheduler-task-all/pom.xml index b60f00df24..cd8a33b8a0 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-all/pom.xml +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-all/pom.xml @@ -27,11 +27,6 @@ dolphinscheduler-task-all - - org.apache.dolphinscheduler - dolphinscheduler-task-conditions - ${project.version} - org.apache.dolphinscheduler @@ -45,12 +40,6 @@ ${project.version} - - org.apache.dolphinscheduler - dolphinscheduler-task-dependent - ${project.version} - - org.apache.dolphinscheduler dolphinscheduler-task-flink @@ -123,18 +112,6 @@ ${project.version} - - org.apache.dolphinscheduler - dolphinscheduler-task-subprocess - ${project.version} - - - - org.apache.dolphinscheduler - dolphinscheduler-task-switch - ${project.version} - - org.apache.dolphinscheduler dolphinscheduler-task-emr @@ -153,12 +130,6 @@ ${project.version} - - org.apache.dolphinscheduler - dolphinscheduler-task-blocking - ${project.version} - - org.apache.dolphinscheduler dolphinscheduler-task-k8s diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-blocking/pom.xml b/dolphinscheduler-task-plugin/dolphinscheduler-task-blocking/pom.xml deleted file mode 100644 index f57d1c0780..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-blocking/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.dolphinscheduler - dolphinscheduler-task-plugin - dev-SNAPSHOT - - - dolphinscheduler-task-blocking - jar - - - - org.apache.dolphinscheduler - dolphinscheduler-spi - provided - - - org.apache.dolphinscheduler - dolphinscheduler-task-api - ${project.version} - - - - diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-blocking/src/main/java/org/apache/dolphinscheduler/plugin/task/blocking/BlockingTaskChannel.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-blocking/src/main/java/org/apache/dolphinscheduler/plugin/task/blocking/BlockingTaskChannel.java deleted file mode 100644 index 388a290097..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-blocking/src/main/java/org/apache/dolphinscheduler/plugin/task/blocking/BlockingTaskChannel.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.blocking; - -import org.apache.dolphinscheduler.common.utils.JSONUtils; -import org.apache.dolphinscheduler.plugin.task.api.AbstractTask; -import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; -import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; -import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; -import org.apache.dolphinscheduler.plugin.task.api.parameters.BlockingParameters; -import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode; -import org.apache.dolphinscheduler.plugin.task.api.parameters.resource.ResourceParametersHelper; - -public class BlockingTaskChannel implements TaskChannel { - - @Override - public void cancelApplication(boolean status) { - - } - - @Override - public AbstractTask createTask(TaskExecutionContext taskRequest) { - return null; - } - - @Override - public AbstractParameters parseParameters(ParametersNode parametersNode) { - return JSONUtils.parseObject(parametersNode.getTaskParams(), BlockingParameters.class); - } - - @Override - public ResourceParametersHelper getResources(String parameters) { - return null; - } -} diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-blocking/src/main/java/org/apache/dolphinscheduler/plugin/task/blocking/BlockingTaskChannelFactory.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-blocking/src/main/java/org/apache/dolphinscheduler/plugin/task/blocking/BlockingTaskChannelFactory.java deleted file mode 100644 index 3398e1e405..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-blocking/src/main/java/org/apache/dolphinscheduler/plugin/task/blocking/BlockingTaskChannelFactory.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.blocking; - -import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_BLOCKING; - -import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; -import org.apache.dolphinscheduler.plugin.task.api.TaskChannelFactory; -import org.apache.dolphinscheduler.spi.params.base.PluginParams; - -import java.util.List; - -import com.google.auto.service.AutoService; - -@AutoService(TaskChannelFactory.class) -public class BlockingTaskChannelFactory implements TaskChannelFactory { - - @Override - public TaskChannel create() { - return new BlockingTaskChannel(); - } - - @Override - public String getName() { - return TASK_TYPE_BLOCKING; - } - - @Override - public List getParams() { - return null; - } -} diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-conditions/pom.xml b/dolphinscheduler-task-plugin/dolphinscheduler-task-conditions/pom.xml deleted file mode 100644 index d4266ae9f9..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-conditions/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.dolphinscheduler - dolphinscheduler-task-plugin - dev-SNAPSHOT - - - dolphinscheduler-task-conditions - jar - - - - org.apache.dolphinscheduler - dolphinscheduler-spi - provided - - - org.apache.dolphinscheduler - dolphinscheduler-task-api - ${project.version} - - - - diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-conditions/src/main/java/org/apache/dolphinscheduler/plugin/task/conditions/ConditionsTaskChannel.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-conditions/src/main/java/org/apache/dolphinscheduler/plugin/task/conditions/ConditionsTaskChannel.java deleted file mode 100644 index d1b32c7f0f..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-conditions/src/main/java/org/apache/dolphinscheduler/plugin/task/conditions/ConditionsTaskChannel.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.conditions; - -import org.apache.dolphinscheduler.common.utils.JSONUtils; -import org.apache.dolphinscheduler.plugin.task.api.AbstractTask; -import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; -import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; -import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; -import org.apache.dolphinscheduler.plugin.task.api.parameters.ConditionsParameters; -import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode; -import org.apache.dolphinscheduler.plugin.task.api.parameters.resource.ResourceParametersHelper; - -public class ConditionsTaskChannel implements TaskChannel { - - @Override - public void cancelApplication(boolean status) { - - } - - @Override - public AbstractTask createTask(TaskExecutionContext taskRequest) { - return null; - } - - @Override - public AbstractParameters parseParameters(ParametersNode parametersNode) { - return JSONUtils.parseObject(parametersNode.getTaskParams(), ConditionsParameters.class); - } - - @Override - public ResourceParametersHelper getResources(String parameters) { - return null; - } -} diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-conditions/src/main/java/org/apache/dolphinscheduler/plugin/task/conditions/ConditionsTaskChannelFactory.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-conditions/src/main/java/org/apache/dolphinscheduler/plugin/task/conditions/ConditionsTaskChannelFactory.java deleted file mode 100644 index 16b083d826..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-conditions/src/main/java/org/apache/dolphinscheduler/plugin/task/conditions/ConditionsTaskChannelFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.conditions; - -import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_CONDITIONS; - -import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; -import org.apache.dolphinscheduler.plugin.task.api.TaskChannelFactory; -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.input.InputParam; -import org.apache.dolphinscheduler.spi.params.radio.RadioParam; - -import java.util.ArrayList; -import java.util.List; - -import com.google.auto.service.AutoService; - -@AutoService(TaskChannelFactory.class) -public class ConditionsTaskChannelFactory implements TaskChannelFactory { - - @Override - public TaskChannel create() { - return new ConditionsTaskChannel(); - } - - @Override - public String getName() { - return TASK_TYPE_CONDITIONS; - } - - @Override - public List getParams() { - List paramsList = new ArrayList<>(); - - InputParam nodeName = InputParam.newBuilder("name", "$t('Node name')") - .addValidate(Validate.newBuilder() - .setRequired(true) - .build()) - .build(); - - RadioParam runFlag = RadioParam.newBuilder("runFlag", "RUN_FLAG") - .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-task-plugin/dolphinscheduler-task-dependent/pom.xml b/dolphinscheduler-task-plugin/dolphinscheduler-task-dependent/pom.xml deleted file mode 100644 index 6fe7635444..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-dependent/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.dolphinscheduler - dolphinscheduler-task-plugin - dev-SNAPSHOT - - - dolphinscheduler-task-dependent - jar - - - - org.apache.dolphinscheduler - dolphinscheduler-spi - provided - - - org.apache.dolphinscheduler - dolphinscheduler-task-api - ${project.version} - - - - diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-dependent/src/main/java/org/apache/dolphinscheduler/plugin/task/dependent/DependentTaskChannel.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-dependent/src/main/java/org/apache/dolphinscheduler/plugin/task/dependent/DependentTaskChannel.java deleted file mode 100644 index 73d6875f7f..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-dependent/src/main/java/org/apache/dolphinscheduler/plugin/task/dependent/DependentTaskChannel.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.dependent; - -import org.apache.dolphinscheduler.common.utils.JSONUtils; -import org.apache.dolphinscheduler.plugin.task.api.AbstractTask; -import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; -import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; -import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; -import org.apache.dolphinscheduler.plugin.task.api.parameters.DependentParameters; -import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode; -import org.apache.dolphinscheduler.plugin.task.api.parameters.resource.ResourceParametersHelper; - -import org.apache.commons.lang3.StringUtils; - -public class DependentTaskChannel implements TaskChannel { - - @Override - public void cancelApplication(boolean status) { - - } - - @Override - public AbstractTask createTask(TaskExecutionContext taskRequest) { - return null; - } - - @Override - public AbstractParameters parseParameters(ParametersNode parametersNode) { - return JSONUtils.parseObject(StringUtils.isEmpty(parametersNode.getDependence()) - ? parametersNode.getTaskParams() - : parametersNode.getDependence(), DependentParameters.class); - } - - @Override - public ResourceParametersHelper getResources(String parameters) { - return null; - } -} diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-dependent/src/main/java/org/apache/dolphinscheduler/plugin/task/dependent/DependentTaskChannelFactory.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-dependent/src/main/java/org/apache/dolphinscheduler/plugin/task/dependent/DependentTaskChannelFactory.java deleted file mode 100644 index 4d323f3388..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-dependent/src/main/java/org/apache/dolphinscheduler/plugin/task/dependent/DependentTaskChannelFactory.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.dependent; - -import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_DEPENDENT; - -import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; -import org.apache.dolphinscheduler.plugin.task.api.TaskChannelFactory; -import org.apache.dolphinscheduler.spi.params.base.PluginParams; - -import java.util.List; - -import com.google.auto.service.AutoService; - -@AutoService(TaskChannelFactory.class) -public class DependentTaskChannelFactory implements TaskChannelFactory { - - @Override - public TaskChannel create() { - return new DependentTaskChannel(); - } - - @Override - public String getName() { - return TASK_TYPE_DEPENDENT; - } - - @Override - public List getParams() { - return null; - } -} diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-subprocess/pom.xml b/dolphinscheduler-task-plugin/dolphinscheduler-task-subprocess/pom.xml deleted file mode 100644 index 383e1d9423..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-subprocess/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.dolphinscheduler - dolphinscheduler-task-plugin - dev-SNAPSHOT - - - dolphinscheduler-task-subprocess - jar - - - - org.apache.dolphinscheduler - dolphinscheduler-spi - provided - - - org.apache.dolphinscheduler - dolphinscheduler-task-api - ${project.version} - - - - diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-subprocess/src/main/java/org/apache/dolphinscheduler/plugin/task/subprocess/SubProcessTaskChannel.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-subprocess/src/main/java/org/apache/dolphinscheduler/plugin/task/subprocess/SubProcessTaskChannel.java deleted file mode 100644 index a277edc37f..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-subprocess/src/main/java/org/apache/dolphinscheduler/plugin/task/subprocess/SubProcessTaskChannel.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.subprocess; - -import org.apache.dolphinscheduler.common.utils.JSONUtils; -import org.apache.dolphinscheduler.plugin.task.api.AbstractTask; -import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; -import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; -import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; -import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode; -import org.apache.dolphinscheduler.plugin.task.api.parameters.SubProcessParameters; -import org.apache.dolphinscheduler.plugin.task.api.parameters.resource.ResourceParametersHelper; - -public class SubProcessTaskChannel implements TaskChannel { - - @Override - public void cancelApplication(boolean status) { - - } - - @Override - public AbstractTask createTask(TaskExecutionContext taskRequest) { - return null; - } - - @Override - public AbstractParameters parseParameters(ParametersNode parametersNode) { - return JSONUtils.parseObject(parametersNode.getTaskParams(), SubProcessParameters.class); - } - - @Override - public ResourceParametersHelper getResources(String parameters) { - return null; - } -} diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-subprocess/src/main/java/org/apache/dolphinscheduler/plugin/task/subprocess/SubProcessTaskChannelFactory.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-subprocess/src/main/java/org/apache/dolphinscheduler/plugin/task/subprocess/SubProcessTaskChannelFactory.java deleted file mode 100644 index c440e265d3..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-subprocess/src/main/java/org/apache/dolphinscheduler/plugin/task/subprocess/SubProcessTaskChannelFactory.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.subprocess; - -import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_SUB_PROCESS; - -import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; -import org.apache.dolphinscheduler.plugin.task.api.TaskChannelFactory; -import org.apache.dolphinscheduler.spi.params.base.PluginParams; - -import java.util.List; - -import com.google.auto.service.AutoService; - -@AutoService(TaskChannelFactory.class) -public class SubProcessTaskChannelFactory implements TaskChannelFactory { - - @Override - public TaskChannel create() { - return new SubProcessTaskChannel(); - } - - @Override - public String getName() { - return TASK_TYPE_SUB_PROCESS; - } - - @Override - public List getParams() { - return null; - } -} diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/pom.xml b/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/pom.xml deleted file mode 100644 index a8a9892b59..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.dolphinscheduler - dolphinscheduler-task-plugin - dev-SNAPSHOT - - - dolphinscheduler-task-switch - jar - - - - org.apache.dolphinscheduler - dolphinscheduler-spi - provided - - - org.apache.dolphinscheduler - dolphinscheduler-task-api - ${project.version} - - - - diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchCondition.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchCondition.java deleted file mode 100644 index 8474950c8c..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchCondition.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.switchtask; - -public class SwitchCondition { - - private String condition; - private Long nextNode; - - public String getCondition() { - return condition; - } - - public void setCondition(String condition) { - this.condition = condition; - } - - public Long getNextNode() { - return nextNode; - } - - public void setNextNode(Long nextNode) { - this.nextNode = nextNode; - } -} diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchParameters.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchParameters.java deleted file mode 100644 index ed7cf1b555..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchParameters.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.switchtask; - -import org.apache.dolphinscheduler.plugin.task.api.model.Property; -import org.apache.dolphinscheduler.plugin.task.api.model.ResourceInfo; -import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; - -import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; - -import java.util.List; - -public class SwitchParameters extends AbstractParameters { - - /** - * shell script - */ - private String rawScript; - - /** - * local parameters - */ - public List localParams; - - private SwitchResult switchResult; - - /** - * resource list - */ - private List resourceList; - - public String getRawScript() { - return rawScript; - } - - public void setRawScript(String rawScript) { - this.rawScript = rawScript; - } - - public List getResourceList() { - return resourceList; - } - - public void setResourceList(List resourceList) { - this.resourceList = resourceList; - } - - @Override - public List getLocalParams() { - return localParams; - } - - @Override - public void setLocalParams(List localParams) { - this.localParams = localParams; - } - - public SwitchResult getSwitchResult() { - return switchResult; - } - - public void setSwitchResult(SwitchResult switchResult) { - this.switchResult = switchResult; - } - - @Override - public boolean checkParameters() { - // default next node should not be null - boolean defaultNode = switchResult != null && switchResult.getNextNode() != null; - if (!defaultNode) { - return false; - } - // validate conditions must have next node - List conditions = this.switchResult.getDependTaskList(); - if (CollectionUtils.isNotEmpty(conditions)) { - if (conditions.stream() - .anyMatch(e -> (StringUtils.isNotEmpty(e.getCondition()) && e.getNextNode() == null))) { - return false; - } - } - return true; - } - - @Override - public List getResourceFilesList() { - return resourceList; - } -} diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchResult.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchResult.java deleted file mode 100644 index f6bb53e719..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchResult.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.switchtask; - -import java.util.List; - -public class SwitchResult { - - private List dependTaskList; - - private Long nextNode; - - public List getDependTaskList() { - return dependTaskList; - } - - public void setDependTaskList(List dependTaskList) { - this.dependTaskList = dependTaskList; - } - - public Long getNextNode() { - return nextNode; - } - - public void setNextNode(Long nextNode) { - this.nextNode = nextNode; - } -} diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchTaskChannel.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchTaskChannel.java deleted file mode 100644 index fe4b830b1d..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchTaskChannel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.switchtask; - -import org.apache.dolphinscheduler.common.utils.JSONUtils; -import org.apache.dolphinscheduler.plugin.task.api.AbstractTask; -import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; -import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; -import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; -import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode; -import org.apache.dolphinscheduler.plugin.task.api.parameters.resource.ResourceParametersHelper; - -public class SwitchTaskChannel implements TaskChannel { - - @Override - public void cancelApplication(boolean status) { - - } - - @Override - public AbstractTask createTask(TaskExecutionContext taskRequest) { - return null; - } - - @Override - public AbstractParameters parseParameters(ParametersNode parametersNode) { - return JSONUtils.parseObject(parametersNode.getTaskParams(), SwitchParameters.class); - } - - @Override - public ResourceParametersHelper getResources(String parameters) { - return null; - } -} diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchTaskChannelFactory.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchTaskChannelFactory.java deleted file mode 100644 index 4a25905d79..0000000000 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-switch/src/main/java/org/apache/dolphinscheduler/plugin/task/switchtask/SwitchTaskChannelFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.plugin.task.switchtask; - -import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; -import org.apache.dolphinscheduler.plugin.task.api.TaskChannelFactory; -import org.apache.dolphinscheduler.plugin.task.api.TaskConstants; -import org.apache.dolphinscheduler.spi.params.base.PluginParams; - -import java.util.List; - -import com.google.auto.service.AutoService; - -@AutoService(TaskChannelFactory.class) -public class SwitchTaskChannelFactory implements TaskChannelFactory { - - @Override - public TaskChannel create() { - return new SwitchTaskChannel(); - } - - @Override - public String getName() { - return TaskConstants.TASK_TYPE_SWITCH; - } - - @Override - public List getParams() { - return null; - } -} diff --git a/dolphinscheduler-task-plugin/pom.xml b/dolphinscheduler-task-plugin/pom.xml index 5327236c2e..6cd6c8a76a 100644 --- a/dolphinscheduler-task-plugin/pom.xml +++ b/dolphinscheduler-task-plugin/pom.xml @@ -43,12 +43,7 @@ dolphinscheduler-task-pigeon dolphinscheduler-task-dataquality dolphinscheduler-task-seatunnel - dolphinscheduler-task-conditions - dolphinscheduler-task-dependent - dolphinscheduler-task-subprocess - dolphinscheduler-task-switch dolphinscheduler-task-emr - dolphinscheduler-task-blocking dolphinscheduler-task-k8s dolphinscheduler-task-zeppelin dolphinscheduler-task-jupyter