wen-hemin commented on a change in pull request #6104:
URL: https://github.com/apache/dolphinscheduler/pull/6104#discussion_r714454073
##########
File path:
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
##########
@@ -1083,4 +1083,11 @@ private Constants() {
public static final String TASK_DEPENDENCE_PROJECT_NAME = "projectName";
public static final String TASK_DEPENDENCE_DEFINITION_ID = "definitionId";
public static final String TASK_DEPENDENCE_DEFINITION_NAME =
"definitionName";
+
+ /**
+ * dry run state
+ */
+ public static final Integer NORMAL_STATE = 0;
+ public static final Integer DRY_RUN_STATE = 1;
Review comment:
DRY_RUN_FLAG_NO and DRY_RUN_FLAG_YES
'state' change to 'flag'
Integer change to int
##########
File path:
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Command.java
##########
@@ -357,6 +373,7 @@ public int hashCode() {
result = 31 * result + (processInstancePriority != null ?
processInstancePriority.hashCode() : 0);
result = 31 * result + (updateTime != null ? updateTime.hashCode() :
0);
result = 31 * result + (workerGroup != null ? workerGroup.hashCode() :
0);
+ result = 31 * result + (dryRun != null ? dryRun.hashCode() : 0);
result = 31 * result + (environmentCode != null ?
environmentCode.hashCode() : 0);
Review comment:
Adjust the order
##########
File path:
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
##########
@@ -191,14 +197,25 @@ public void run() {
this.task.init();
//init varPool
this.task.getParameters().setVarPool(taskExecutionContext.getVarPool());
- // task handle
- this.task.handle();
- // task result process
- if (this.task.getNeedAlert()) {
- sendAlert(this.task.getTaskAlertInfo());
+ taskInstanceMapper =
SpringApplicationContext.getBean(TaskInstanceMapper.class);
+ TaskInstance taskInstance =
taskInstanceMapper.selectById(taskExecutionContext.getTaskInstanceId());
Review comment:
You can use the method "ProcessService.findTaskInstanceById()", no need
introduce the TaskInstanceMapper class
##########
File path: sql/dolphinscheduler_mysql.sql
##########
@@ -332,6 +332,7 @@ CREATE TABLE `t_ds_command` (
`process_instance_priority` int(11) DEFAULT NULL COMMENT 'process instance
priority: 0 Highest,1 High,2 Medium,3 Low,4 Lowest',
`worker_group` varchar(64) COMMENT 'worker group',
`environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
+ `dry_run` int NULL DEFAULT 0 COMMENT 'dry run stateļ¼0 normal, 1 dry run',
Review comment:
'state' change to 'flag'
##########
File path:
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
##########
@@ -191,14 +197,25 @@ public void run() {
this.task.init();
//init varPool
this.task.getParameters().setVarPool(taskExecutionContext.getVarPool());
Review comment:
Does the previous code need to be executed when dry run?
--
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]