niumy0701 commented on code in PR #17718:
URL:
https://github.com/apache/dolphinscheduler/pull/17718#discussion_r2597528026
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-dms/src/main/java/org/apache/dolphinscheduler/plugin/task/dms/DmsTask.java:
##########
@@ -78,6 +80,42 @@ public void init() throws TaskException {
initDmsHook();
}
+ /**
+ * If appIds is empty, submit a new remote application; otherwise, just
track application status.
+ *
+ * @param taskCallBack
+ * @throws TaskException
+ */
+ @Override
+ public void handle(TaskCallBack taskCallBack) throws TaskException {
+ try {
+ // if appIds is not empty, just track application status, avoid
resubmitting remote task
+ if (StringUtils.isNotEmpty(taskRequest.getAppIds())) {
+ setAppIds(taskRequest.getAppIds());
+ trackApplicationStatus();
+ return;
+ }
+
+ // submit a remote application
+ submitApplication();
+
+ if (StringUtils.isNotEmpty(getAppIds())) {
+ taskRequest.setAppIds(getAppIds());
+ // callback to update remote application info
+
taskCallBack.updateRemoteApplicationInfo(taskRequest.getTaskInstanceId(),
+ new ApplicationInfo(getAppIds()));
+ }
+
+ // keep tracking application status
+ trackApplicationStatus();
Review Comment:
> AWS DMS task types will not be submitted to yarn or k8s for execution, so
this logic should not be added.
DMSTask also executes the handle method. When rewriting the handle method, I
added the logic to close resources
--
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]