zhongjiajie commented on code in PR #14129:
URL: 
https://github.com/apache/dolphinscheduler/pull/14129#discussion_r1197273539


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/EngineEnum.java:
##########
@@ -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.seatunnel;
-
-public enum EngineEnum {
-
-    FLINK("${SEATUNNEL_HOME}/bin/start-seatunnel-flink.sh"),
-    SPARK("${SEATUNNEL_HOME}/bin/start-seatunnel-spark.sh"),

Review Comment:
   delete the enum class due to seatunnel changing its startup script, so 
currently we have to support
   
   ```
   seatunnel.sh
   start-seatunnel-flink-13-connector-v2.sh
   start-seatunnel-flink-15-connector-v2.sh
   start-seatunnel-flink-connector-v2.sh
   start-seatunnel-flink.sh
   start-seatunnel-spark-2-connector-v2.sh
   start-seatunnel-spark-3-connector-v2.sh
   start-seatunnel-spark-connector-v2.sh
   start-seatunnel-spark.sh
   ```
   
   nine startups in both frontend and backend. Since we do not know whether 
seatunnel will change their startup script in the future or not. So I think we 
should remove this enum and just use the startup script name from front-end. 
please notice we do not ask users manually enter the startup script name 
because we provide drop-down box for it. Add this just for reducing the code 
change scope when startup script adding/changing



##########
docs/docs/zh/guide/task/seatunnel.md:
##########
@@ -16,7 +16,7 @@
 [//]: # (- 
默认参数说明请参考[DolphinScheduler任务参数附录](appendix.md#默认任务参数)`默认任务参数`一栏。)
 
 - 默认参数说明请参考[DolphinScheduler任务参数附录](appendix.md)`默认任务参数`一栏。
-- 引擎:支持 FLINK 、 SPARK 和 SEATUNNEL_ENGINE
+- 启动脚本:你想要通过什么启动脚本启动任务,包括 `seatunnel.sh`, 
`start-seatunnel-flink-13-connector-v2.sh`, 
`start-seatunnel-flink-15-connector-v2.sh`, 
`start-seatunnel-flink-connector-v2.sh`, `start-seatunnel-flink.sh`, 
`start-seatunnel-spark-2-connector-v2.sh`, 
`start-seatunnel-spark-3-connector-v2.sh`, 
`start-seatunnel-spark-connector-v2.sh`, `start-seatunnel-spark.sh`

Review Comment:
   ```suggestion
   - 启动脚本:选择你想要运行任务的启动脚本,包括 `seatunnel.sh`, 
`start-seatunnel-flink-13-connector-v2.sh`, 
`start-seatunnel-flink-15-connector-v2.sh`, 
`start-seatunnel-flink-connector-v2.sh`, `start-seatunnel-flink.sh`, 
`start-seatunnel-spark-2-connector-v2.sh`, 
`start-seatunnel-spark-3-connector-v2.sh`, 
`start-seatunnel-spark-connector-v2.sh`, `start-seatunnel-spark.sh`
   ```



##########
dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/SeatunnelTaskChannel.java:
##########
@@ -38,17 +42,18 @@ public void cancelApplication(boolean status) {
     public SeatunnelTask createTask(TaskExecutionContext taskRequest) {
         SeatunnelParameters seatunnelParameters =
                 JSONUtils.parseObject(taskRequest.getTaskParams(), 
SeatunnelParameters.class);
-        switch (seatunnelParameters.getEngine()) {
-            case FLINK:
-            case FLINK_V2:
-                return new SeatunnelFlinkTask(taskRequest);
-            case SPARK:
-            case SPARK_V2:
-                return new SeatunnelSparkTask(taskRequest);
-            case SEATUNNEL_ENGINE:
-                return new SeatunnelEngineTask(taskRequest);
+        assert seatunnelParameters != null;
+        String startupScript = seatunnelParameters.getStartupScript();
+        if (startupScript.contains(STARTUP_SCRIPT_SPARK)) {

Review Comment:
   change from equal enums to startup script contain specific string or not



##########
docs/docs/en/guide/task/seatunnel.md:
##########
@@ -16,7 +16,7 @@ Click [here](https://seatunnel.apache.org/) for more 
information about `Apache S
 [//]: # (- Please refer to [DolphinScheduler Task Parameters 
Appendix](appendix.md#default-task-parameters) `Default Task 
Parameters` section for default parameters.)
 
 - Please refer to [DolphinScheduler Task Parameters Appendix](appendix.md) 
`Default Task Parameters` section for default parameters.
-- Engine: Supports FLINK, SPARK AND SEATUNNEL_ENGINE
+- Startup script: Script name to start the task, including `seatunnel.sh`, 
`start-seatunnel-flink-13-connector-v2.sh`, 
`start-seatunnel-flink-15-connector-v2.sh`, 
`start-seatunnel-flink-connector-v2.sh`, `start-seatunnel-flink.sh`, 
`start-seatunnel-spark-2-connector-v2.sh`, 
`start-seatunnel-spark-3-connector-v2.sh`, 
`start-seatunnel-spark-connector-v2.sh`, `start-seatunnel-spark.sh`

Review Comment:
   ```suggestion
   - Startup script: Select script name to start the task, including 
`seatunnel.sh`, `start-seatunnel-flink-13-connector-v2.sh`, 
`start-seatunnel-flink-15-connector-v2.sh`, 
`start-seatunnel-flink-connector-v2.sh`, `start-seatunnel-flink.sh`, 
`start-seatunnel-spark-2-connector-v2.sh`, 
`start-seatunnel-spark-3-connector-v2.sh`, 
`start-seatunnel-spark-connector-v2.sh`, `start-seatunnel-spark.sh`
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to