zhongjiajie commented on code in PR #10689:
URL: https://github.com/apache/dolphinscheduler/pull/10689#discussion_r930569935
##########
docs/docs/en/guide/task/java.md:
##########
@@ -0,0 +1,48 @@
+# Overview
+
+This node is used to perform java-type tasks and supports the use of single
files and jar packages as program entries.
+
+# Create Tasks
+
+- Click on project management-> Project name-> workflow definition, click on
the“Create workflow” button, go to the DAG edit page:
+
+- Drag the toolbar's Java task node to the palette.
+
+# Task Parameters
+| **Parameter** | **Description** |
+| ------- | ---------- |
+|Node Name|the name of the set task. The node name in a workflow definition is
unique.
+|Run Flag|indicates whether the node is scheduled properly and, if it is not
needed, turns on the kill switch.
+|Description|describes the functionality of the node.
+|Task Priority|when the number of worker threads is insufficient, the worker
is executed according to the priority from high to low. When the priority is
the same, the worker is executed according to the first in, first out principle.
+|Worker Group|The machine whose task is assigned to the Worker group executes,
and selecting Default will randomly select a Worker machine to execute.
+|Environment Name|configure the environment in which the task runs.
+|Number Of Failed Retries|number of resubmitted tasks that failed, supported
drop-down and hand-fill.
+|Failed Retry Interval|the interval between tasks that fail and are
resubmitted, supported by drop-down and hand-fill.
+|Delayed Execution Time|the amount of time a task is delayed, in units.
+|Timeout Alarm|Check timeout warning, timeout failure, when the task exceeds
the“Timeout length”, send a warning message and the task execution fails.
+|Module Path|turn on the use of Java 9 + 's modularity feature, put all
resources into-module-path, and require that the JDK version in your worker
support modularity.
+|Main Parameter|as a normal Java program main method entry parameter.
+|Java VM Parameters|configure startup virtual machine parameters.
+|Script|you need to write Java code if you use the Java run type. The public
class must exist in the code without writing a package statement.
+|Resources|these can be external JAR packages or other resource files that are
added to the Classpath or module path and can be easily retrieved in your JAVA
script.
+|Custom parameter|a user-defined parameter that is part of HTTP and replaces
the contents of the script with the ${ variable } .
+|Pre Tasks|selecting a pre-task for the current task sets the selected
pre-task upstream of the current task.
Review Comment:
can you add `|` in the end of this table to make it supports the full
Markdown table format?
```diff
- |Node Name|the name of the set task. The node name in a workflow
definition is unique.
+ | Node Name | the name of the set task. The node name in a workflow
definition is unique. |
```
##########
docs/docs/en/guide/task/java.md:
##########
@@ -0,0 +1,48 @@
+# Overview
+
+This node is used to perform java-type tasks and supports the use of single
files and jar packages as program entries.
+
+# Create Tasks
+
+- Click on project management-> Project name-> workflow definition, click on
the“Create workflow” button, go to the DAG edit page:
+
+- Drag the toolbar's Java task node to the palette.
+
+# Task Parameters
+| **Parameter** | **Description** |
+| ------- | ---------- |
+|Node Name|the name of the set task. The node name in a workflow definition is
unique.
+|Run Flag|indicates whether the node is scheduled properly and, if it is not
needed, turns on the kill switch.
+|Description|describes the functionality of the node.
+|Task Priority|when the number of worker threads is insufficient, the worker
is executed according to the priority from high to low. When the priority is
the same, the worker is executed according to the first in, first out principle.
+|Worker Group|The machine whose task is assigned to the Worker group executes,
and selecting Default will randomly select a Worker machine to execute.
+|Environment Name|configure the environment in which the task runs.
+|Number Of Failed Retries|number of resubmitted tasks that failed, supported
drop-down and hand-fill.
+|Failed Retry Interval|the interval between tasks that fail and are
resubmitted, supported by drop-down and hand-fill.
+|Delayed Execution Time|the amount of time a task is delayed, in units.
+|Timeout Alarm|Check timeout warning, timeout failure, when the task exceeds
the“Timeout length”, send a warning message and the task execution fails.
+|Module Path|turn on the use of Java 9 + 's modularity feature, put all
resources into-module-path, and require that the JDK version in your worker
support modularity.
+|Main Parameter|as a normal Java program main method entry parameter.
+|Java VM Parameters|configure startup virtual machine parameters.
+|Script|you need to write Java code if you use the Java run type. The public
class must exist in the code without writing a package statement.
+|Resources|these can be external JAR packages or other resource files that are
added to the Classpath or module path and can be easily retrieved in your JAVA
script.
+|Custom parameter|a user-defined parameter that is part of HTTP and replaces
the contents of the script with the ${ variable } .
+|Pre Tasks|selecting a pre-task for the current task sets the selected
pre-task upstream of the current task.
+
+## Example
+
+Java task types have two modes of execution, which are demonstrated here as an
example of a Java mode.
+
+The main configuration parameters are as follows:
+- Run Type
+- Module Path
+- Main Parameters
+- Java VM Parameters
+
Review Comment:
```suggestion
```
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-java/src/main/java/org/apache/dolphinscheduler/plugin/task/java/JavaParameters.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * 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.java;
+
+import org.apache.dolphinscheduler.plugin.task.api.model.ResourceInfo;
+import
org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters;
+
+import java.util.List;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@Getter
+@Setter
+@ToString
+public class JavaParameters extends AbstractParameters {
+ /**
+ * origin java script
+ */
+ private String rawScript;
+
+ /**
+ * run in jar file
+ */
+ private ResourceInfo mainJar;
+
+ /**
+ * run type is JAVA or JAR
+ */
+ private String runType;
+
+ /**
+ * main method args
+ **/
+ private String mainArgs;
+
+ /**
+ * jvm args
+ **/
+ private String jvmArgs;
+
+ /**
+ * module path or class path flag
+ **/
+ private boolean isModulePath;
+
+ /**
+ * resource list
+ */
+ private List<ResourceInfo> resourceList;
+
+ /**
+ * @description:
+ * @date: 7/22/22 2:35 AM
+ * @param: []
Review Comment:
I find it still in class `JavaTask.java`, could you search global and remove
them?
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-java/src/main/java/org/apache/dolphinscheduler/plugin/task/java/JavaParameters.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * 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.java;
+
+import org.apache.dolphinscheduler.plugin.task.api.model.ResourceInfo;
+import
org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters;
+
+import java.util.List;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+@Getter
+@Setter
+@ToString
+public class JavaParameters extends AbstractParameters {
+ /**
+ * origin java script
+ */
+ private String rawScript;
+
+ /**
+ * run in jar file
+ */
+ private ResourceInfo mainJar;
+
+ /**
+ * run type is JAVA or JAR
+ */
+ private String runType;
+
+ /**
+ * main method args
+ **/
+ private String mainArgs;
+
+ /**
+ * jvm args
+ **/
+ private String jvmArgs;
+
+ /**
+ * module path or class path flag
+ **/
+ private boolean isModulePath;
+
+ /**
+ * resource list
+ */
+ private List<ResourceInfo> resourceList;
+
+ /**
+ * @description:
+ * @date: 7/22/22 2:35 AM
+ * @param: []
Review Comment:
can we remove this unnecessary part? same as function `getResourceFilesList`
--
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]