-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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-19519] [Runtime/Configuration] Support port range for Taskmanager data port configuration #15704
base: master
Are you sure you want to change the base?
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 3031e1c (Fri May 28 09:10:45 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:
|
private final String serverPortRange; | ||
private final Iterator<Integer> serverPortRangeIterator; |
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 looks like serverPortRangeIterator
can be created using serverPortRange
, but is there a reason to keep both fields?
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.
Originally, serverPort
was used to generate the Netty thread group name. So when I replace serverPort
with serverPortRangeIterator
, I also include serverPortRange
for that purpose.
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 point of my question is, isn't one field enough? For example, if there is only the serverPortRange
field, can't the iterator be created at the desired time using a getter method?
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.
Because NetUtils.getPortRangeFromString
also does validation, the iterator is generated during configuration parsing phase, so that if there's any configuration error, the user will be notified earlier.
What is the purpose of the change
This change adds support for setting a port range for a TaskManager data port, which allows multiple TaskManager to run on the same machine without having to use a random port.
Brief change log
taskmanager.data.bind-port
from Integer to String.NetUtils.getPortRangeFromString
to generate the list of ports that can be used from the value oftaskmanager.data.bind-port
taskmanager.data.bind-port
Verifying this change
NetUtils.getPortRangeFromString
is reused and already covered by existing tests.NettyServerMultiPortsTest
, to verify that you can start 2 NettyServer concurrently without conflict by setting multiple ports intaskmanager.data.bind-port
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation