|
|
@ -21,7 +21,6 @@ import org.apache.dolphinscheduler.common.enums.TaskEventType; |
|
|
|
import org.apache.dolphinscheduler.plugin.task.api.enums.ExecutionStatus; |
|
|
|
import org.apache.dolphinscheduler.plugin.task.api.enums.ExecutionStatus; |
|
|
|
import org.apache.dolphinscheduler.remote.command.TaskExecuteResultCommand; |
|
|
|
import org.apache.dolphinscheduler.remote.command.TaskExecuteResultCommand; |
|
|
|
import org.apache.dolphinscheduler.remote.command.TaskExecuteRunningCommand; |
|
|
|
import org.apache.dolphinscheduler.remote.command.TaskExecuteRunningCommand; |
|
|
|
import org.apache.dolphinscheduler.remote.utils.ChannelUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
|
|
|
@ -105,7 +104,7 @@ public class TaskEvent { |
|
|
|
return event; |
|
|
|
return event; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static TaskEvent newRunningEvent(TaskExecuteRunningCommand command, Channel channel) { |
|
|
|
public static TaskEvent newRunningEvent(TaskExecuteRunningCommand command, Channel channel, String workerAddress) { |
|
|
|
TaskEvent event = new TaskEvent(); |
|
|
|
TaskEvent event = new TaskEvent(); |
|
|
|
event.setProcessInstanceId(command.getProcessInstanceId()); |
|
|
|
event.setProcessInstanceId(command.getProcessInstanceId()); |
|
|
|
event.setTaskInstanceId(command.getTaskInstanceId()); |
|
|
|
event.setTaskInstanceId(command.getTaskInstanceId()); |
|
|
@ -114,12 +113,12 @@ public class TaskEvent { |
|
|
|
event.setExecutePath(command.getExecutePath()); |
|
|
|
event.setExecutePath(command.getExecutePath()); |
|
|
|
event.setLogPath(command.getLogPath()); |
|
|
|
event.setLogPath(command.getLogPath()); |
|
|
|
event.setChannel(channel); |
|
|
|
event.setChannel(channel); |
|
|
|
event.setWorkerAddress(ChannelUtils.toAddress(channel).getAddress()); |
|
|
|
event.setWorkerAddress(workerAddress); |
|
|
|
event.setEvent(TaskEventType.RUNNING); |
|
|
|
event.setEvent(TaskEventType.RUNNING); |
|
|
|
return event; |
|
|
|
return event; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static TaskEvent newResultEvent(TaskExecuteResultCommand command, Channel channel) { |
|
|
|
public static TaskEvent newResultEvent(TaskExecuteResultCommand command, Channel channel, String workerAddress) { |
|
|
|
TaskEvent event = new TaskEvent(); |
|
|
|
TaskEvent event = new TaskEvent(); |
|
|
|
event.setProcessInstanceId(command.getProcessInstanceId()); |
|
|
|
event.setProcessInstanceId(command.getProcessInstanceId()); |
|
|
|
event.setTaskInstanceId(command.getTaskInstanceId()); |
|
|
|
event.setTaskInstanceId(command.getTaskInstanceId()); |
|
|
@ -132,7 +131,7 @@ public class TaskEvent { |
|
|
|
event.setAppIds(command.getAppIds()); |
|
|
|
event.setAppIds(command.getAppIds()); |
|
|
|
event.setVarPool(command.getVarPool()); |
|
|
|
event.setVarPool(command.getVarPool()); |
|
|
|
event.setChannel(channel); |
|
|
|
event.setChannel(channel); |
|
|
|
event.setWorkerAddress(ChannelUtils.toAddress(channel).getAddress()); |
|
|
|
event.setWorkerAddress(workerAddress); |
|
|
|
event.setEvent(TaskEventType.RESULT); |
|
|
|
event.setEvent(TaskEventType.RESULT); |
|
|
|
return event; |
|
|
|
return event; |
|
|
|
} |
|
|
|
} |
|
|
|