ruanwenjun commented on code in PR #18549:
URL:
https://github.com/apache/dolphinscheduler/pull/18549#discussion_r4255888531
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/AbstractTask.java:
##########
@@ -109,20 +123,53 @@ public void setAppIds(String appIds) {
this.appIds = appIds;
}
+ /**
+ * @deprecated Use {@link TaskExecutionContext#isNeedAlert()} on the
+ * {@code taskRequest} field instead. This method is retained
as a
+ * compatibility bridge so that third-party plugins compiled
against
+ * the previous AbstractTask API continue to work. The value
is merged
+ * with the legacy field so that direct field writes from such
plugins
+ * are still honored.
+ */
+ @Deprecated
public boolean getNeedAlert() {
- return needAlert;
+ return needAlert || (taskRequest != null && taskRequest.isNeedAlert());
}
+ /**
+ * @deprecated Use {@link TaskExecutionContext#setNeedAlert(boolean)} on
the
+ * {@code taskRequest} field instead.
+ */
+ @Deprecated
public void setNeedAlert(boolean needAlert) {
this.needAlert = needAlert;
+ if (taskRequest != null) {
+ taskRequest.setNeedAlert(needAlert);
+ }
Review Comment:
```suggestion
taskRequest.setNeedAlert(needAlert);
```
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/AbstractTask.java:
##########
@@ -56,8 +56,22 @@ public abstract class AbstractTask {
*/
protected volatile int exitStatusCode = -1;
+ /**
+ * @deprecated Use {@link TaskExecutionContext#isNeedAlert()} on the
+ * {@code taskRequest} field instead. Retained for binary
+ * compatibility with third-party plugins compiled against
+ * the previous AbstractTask API.
+ */
+ @Deprecated
protected boolean needAlert = false;
+ /**
+ * @deprecated Use {@link TaskExecutionContext#getTaskAlertInfo()} on the
+ * {@code taskRequest} field instead. Retained for binary
+ * compatibility with third-party plugins compiled against
+ * the previous AbstractTask API.
+ */
+ @Deprecated
protected TaskAlertInfo taskAlertInfo;
Review Comment:
It's better to remove this.
--
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]