Skip to content
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

Closed
wants to merge 18 commits into from

Conversation

XComp
Copy link
Contributor

@XComp XComp commented Jan 8, 2021

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

  • The 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:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 8, 2021

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 51e4355 (Fri May 28 07:06:42 UTC 2021)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

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 commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 8, 2021

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

@tillrohrmann tillrohrmann changed the title [FLINK-20580][runtime] Removing usage of CoLocationConstraints [FLINK-20850][runtime] Removing usage of CoLocationConstraints Jan 8, 2021
@XComp XComp force-pushed the feature/FLINK-20850 branch 3 times, most recently from a722171 to 4393af4 Compare January 8, 2021 16:06
@XComp
Copy link
Contributor Author

XComp commented Jan 11, 2021

The refactoring is ready to be reviewed. Please also have a look at the docs changes that were necessary due to the refactoring.
@zhuzhurk It would be helpful for you to have a look as well.

@zhuzhurk
Copy link
Contributor

@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
@XComp
Copy link
Contributor Author

XComp commented Jan 11, 2021

@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.

Ok, @rmetzger merged the previous PRs. I rebased master...

Copy link
Contributor

@zhuzhurk zhuzhurk left a 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.

Minor renamings are applied that were brought up during the review.
Additionally, missing JavaDoc was added.
Copy link
Contributor

@rmetzger rmetzger left a 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;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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()));
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my answer above.

@rmetzger
Copy link
Contributor

I'll merge the change now! Thanks for working on this!

@rmetzger rmetzger closed this in ac968b8 Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants