-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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-17057][Master]Check if the WorkflowGrapth is a dag at constructor #17058
base: dev
Are you sure you want to change the base?
Conversation
Thanks for opening this pull request! Please check out our contributing guidelines. (https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md) |
...ster/src/main/java/org/apache/dolphinscheduler/server/master/engine/graph/WorkflowGraph.java
Fixed
Show fixed
Hide fixed
...ster/src/main/java/org/apache/dolphinscheduler/server/master/engine/graph/WorkflowGraph.java
Fixed
Show fixed
Hide fixed
Update: When a ring exists, it is not a DAG |
@SbloodyS Hello, please take a look. |
@SbloodyS The Mergeable check failed because this PR was not added to the milestone. |
|
@@ -57,6 +59,22 @@ public WorkflowGraph(List<WorkflowTaskRelation> workflowTaskRelations, List<Task | |||
addTaskEdge(workflowTaskRelations); | |||
} | |||
|
|||
private void checkIfDAG(List<WorkflowTaskRelation> workflowTaskRelations, List<TaskDefinition> taskDefinitions) { | |||
DAG<Long, TaskDefinition, WorkflowTaskRelation> graph = new DAG<>(); |
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.
Please don't use DAG
, this class will be removed in the future.
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.
つ﹏⊂
So, are there other implemented classes?
Otherwise I will implement it using my previous commit.
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.
@ruanwenjun PTAL
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.
WorkflowGraph
is used to replace DAG
ce52582
to
c537e51
Compare
@ruanwenjun PTAL |
ae02625
to
a85f8a9
Compare
a85f8a9
to
88863d5
Compare
Purpose of the pull request
Check if the WorkflowGrapth is a dag close #17057
Brief change log
Conclusion: A graph is not a DAG if its task length is less than the total number of tasks after topological sorting
Verify this pull request
This change added tests and can be verified as follows:
Pull Request Notice
Pull Request Notice
If your pull request contains incompatible change, you should also add it to
docs/docs/en/guide/upgrade/incompatible.md