-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improvement-16887][Dependent Task] Dependet task improvement #16910
base: dev
Are you sure you want to change the base?
Conversation
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
@EqualsAndHashCode(callSuper = true) |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
TaskInstance.canEqual
...ache/dolphinscheduler/server/master/engine/executor/plugin/dependent/DependentLogicTask.java
Fixed
Show fixed
Hide fixed
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
@EqualsAndHashCode(callSuper = true) |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
DependentItem.canEqual
} else { | ||
TaskDefinition taskDefinition = taskDefinitionMap.get(dependentItem.getDepTaskCode()); | ||
taskDependentResult.setTaskDefinitionCode(taskDefinition.getCode()); | ||
taskDependentResultDao.upsertTaskDependentResult(taskDependentResult); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if we can set the dependent result into taskInstance's app_link, then we can avoid importing a table here and we can also avoid query the dependent result in other place. cc @caishunfeng
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TaskInstance's app_link is used to store yarn application ids. So I think it's not a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to add a field runtime_context
to store all runtime context if need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll create a new table t_ds_task_instance_context
to store context
.
@@ -48,7 +49,8 @@ | |||
TaskDefinitionDao taskDefinitionDao, | |||
TaskInstanceDao taskInstanceDao, | |||
WorkflowInstanceDao workflowInstanceDao, | |||
IWorkflowExecutionRunnable workflowExecutionRunnable) { | |||
IWorkflowExecutionRunnable workflowExecutionRunnable, |
Check notice
Code scanning / CodeQL
Useless parameter Note
Quality Gate failedFailed conditions |
|
||
private String context; | ||
|
||
private ContextType contextType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if we need to add context type here, one task instance should only have one context? or we will add more type in the future? e.g. RESULT_CONTEXT
, RUNTIME_CONTEXT
. If we will move more context into this table, it's better to change the enum in ContextType
to RESULT_CONTEXT
and RUNTIME_CONTEXT
, otherwise, there might bring a lot of type here, and the type is only used to do deserization, we can move the task type into context
, then we can use @JsonSubTypes to help us do serialization, some example can find at ICommandParam.
|
||
DEPENDENT_RESULT(1, "dependent task result"); | ||
|
||
@EnumValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to store name to db rather than code, this will not cost big performance, but will help to have better readability.
|
||
@EqualsAndHashCode(callSuper = true) | ||
@Data | ||
public class TaskInstanceDependentResult extends TaskInstance { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to add a new class like below, the inheritance relationship looks strange.
public class TaskInstanceDetails {
private TaskInstance taskInstance;
private TaskInstanceContext taskInstanceContext;
}
import lombok.Data; | ||
|
||
@Data | ||
public class TaskInstanceDependentResultContext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an interface TaskInstanceResultContext
can help us to do deserialization.
Purpose of the pull request
close #16887
Brief change log
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
Pull Request Notice
Pull Request Notice
If your pull request contain incompatible change, you should also add it to
docs/docs/en/guide/upgrede/incompatible.md