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
[FLINK-20850][runtime] Removing usage of CoLocationConstraints #14584
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 51e4355 (Fri May 28 07:06:42 UTC 2021) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
a722171
to
4393af4
Compare
The refactoring is ready to be reviewed. Please also have a look at the docs changes that were necessary due to the refactoring. |
@XComp how about we get the base PRs merged before continuing with this PR? I can see that all the base PRs are approved already. |
Removed DefaultExecutionTopology.ensureCoLocatedVerticesInSameRegion(..) as CoLocationConstraint is not used anymore. FLINK-20589
Remove CoLocationConstraint from ExeuctionVertexSchedulingRequirements as it is not used anymore. FLINK-20589
This test verifies that the CoLocationConstraint is reset when recovering the task. We still need to verify whether it should be replaced. FLINK-20589
This test verifies that the CoLocationConstraints are created which is not the case anymore. FLINK-20589
…rtex The CoLocation information isn't processed through the ExecutionVertex anymore but is calculated statically by the LocalInputPreferredSlotSharingStrategy. FLINK-20589
The CoLocationConstraints are not used anymore but replaced by LocalInputPreferredSlotSharingStrategy. FLINK-20589
The CoLocationConstraints is not used anymore and, therefore, can be removed from the CoLocationGroup. FLINK-20589
CoLocationConstraint is deleted. Its JavaDoc is copied over to CoLocationConstraintDesc and adjusted accordingly. FLINK-20589
The CoLocationGroup only needs to be adapted within JobVertex. Any other locations can rely on CoLocationGroupDesc's read-only methods. FLINK-20589
Minor cleanup to follow Intellij suggestions. FLINK-20589
Previously, the CoLocationConstraints have been reset in this method. The CoLocationGroup handling is not needed anymore after the reset functionality was removed. FLINK-20589
…face The interface CoLocationGroupDesc was introduced wherever possible. FLINK-20589
We need to ensure that co-located tasks are executed in the same pipeline region. Hence, 8b1510c was reverted. FLINK-20589
CoLocationGroupDesc.getVertices was renamed: The refactoring changed the return type and, therefore, made the renaming necessary. FLINK-20589
The old implementation relied on the CoLocationConstraint only being created once. Switching to CoLocationConstraintDesc changed that behavior. Hence, we have to switch from IdentityHashMap to HashMap. FLINK-20589
After finalizing the refactoring of removing CoLocationConstraint and making CoLocationGroupDesc an interface, it is now reasonable to rename the affected classes and interfaces accordingly: * CoLocationGroup -> CoLocationGroupImpl * CoLocationGroupDesc -> CoLocationGroup * CoLocationConstraintDesc -> CoLocationConstraint FLINK-20589
FLINK-20589
daed89f
to
7dea123
Compare
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.
Thanks for opening this PR. The changes look quite good to me. There are just several minor comments.
+1 to merge it once the minor comments are addressed.
flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java
Outdated
Show resolved
Hide resolved
flink-runtime/src/main/java/org/apache/flink/runtime/jobmanager/scheduler/CoLocationGroup.java
Outdated
Show resolved
Hide resolved
flink-runtime/src/test/java/org/apache/flink/runtime/jobgraph/JobGraphTest.java
Outdated
Show resolved
Hide resolved
Minor renamings are applied that were brought up during the review. Additionally, missing JavaDoc was added.
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.
Except for one comment, the change seems mostly fine.
CoLocationGroup thisGroup = this.coLocationGroup; | ||
CoLocationGroup otherGroup = strictlyCoLocatedWith.coLocationGroup; | ||
CoLocationGroupImpl thisGroup = this.coLocationGroup; | ||
CoLocationGroupImpl otherGroup = strictlyCoLocatedWith.coLocationGroup; |
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.
Wouldn't it be cleaner to add the addVertex()
method to the CoLocationGroup
interface?
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.
The idea was to have a readonly interface as the colocation groups do not need to be changed after initialization.
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 see, this is only the initialization.
coLocationGroups.computeIfAbsent( | ||
coLocationGroupKey, | ||
k -> new Tuple2<>(sharingGroup, new CoLocationGroup())); | ||
k -> new Tuple2<>(sharingGroup, new CoLocationGroupImpl())); |
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.
Adding the addVertex method to the interface would not require touching this test
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.
See my answer above.
I'll merge the change now! Thanks for working on this! |
What is the purpose of the change
The
CoLocationConstraint
class became obsolete when introducing FLINK-18690.This PR depends on PR #14580 covering FLINK-20892.
Brief change log
CoLocationConstraint
was removed from the code clearing any existing member fields and updating/removing related test cases.Verifying this change
CI Build
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation