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-11707][network] Make InputGate extend AutoCloseable #7785

Merged
merged 2 commits into from
Mar 27, 2019

Conversation

zhijiangW
Copy link
Contributor

What is the purpose of the change

This is a sub-task for refactoring the interface of InputGate which would be created by ShuffleService future. So it is reasonable to reference with general InputGate anywhere instead of specific SingleInputGate.

To make InputGate extend AutoCloseable interface, the TaskCanceler could call InputGate#close instead of SingleInputGate#releaseAllResources.

Next we can further remove the reference with SingleInputGate in Task class by refactoring the updatePartitionInfo into NetworkEnvironment.

Brief change log

  • Make InputGate extend AutoCloseable interface
  • Change to reference with InputGate in TaskCanceler
  • Rename releaseAllResources into close in ResultPartition

Verifying this change

This change is already covered by existing tests, such as SingleInputGateTest.

Does this pull request potentially affect one of the following parts:

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

Documentation

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

@flinkbot
Copy link
Collaborator

flinkbot commented Feb 21, 2019

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.

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

Copy link
Contributor

@azagrebin azagrebin 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 the PR @zhijiangW !
I think it looks good, I left only one comment to discuss.

@@ -264,6 +265,23 @@ public int getPageSize() {
return pageSize;
}

@Override
public void close() throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

UnionInputGate looks like something core Flink specific, some artificial abstraction, not related to ShuffleService.
At the moment, it is virtual and does not have real resources behind.
I would not even call it InputGate from shuffle service perspective, it is rather a partial decorator.
The real gates are managed by Task, one level down of abstraction.
Although, this close implementation looks logical, currently, it is not used.
My concern is that if we leave it, it might confuse in future: somebody might start calling it and break the lifecycle of real gates managed only by Task atm. As it is just a refactoring, I would leave this close method empty then, because it looks like it is not supposed to be used anyways.
or you think, there is another reason to have it like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I totally agree with you above points. Thanks for kindly reminder!

@zhijiangW
Copy link
Contributor Author

@azagrebin , thanks for the reviews! I agree with you above comments and submit a fixup commit for addressing it.

Copy link
Contributor

@azagrebin azagrebin 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 addressing the comment @zhijiangW ! LGTM 👍

@zentol zentol merged commit dd5ad2c into apache:master Mar 27, 2019
@zhijiangW zhijiangW deleted the FLINK-11707 branch May 29, 2020 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants