-
Notifications
You must be signed in to change notification settings - Fork 13.9k
[FLINK-38943][runtime] Support Adaptive Partition Selection for RescalePartitioner and RebalancePartitioner #27446
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
base: master
Are you sure you want to change the base?
Conversation
046c85b to
e5ea873
Compare
|
Hi, @davidradl @X-czh Could you help take a look ? thx a lot. |
e5ea873 to
b95259b
Compare
|
@flinkbot run azure |
|
@RocMarshal Thanks for the quick contribution. I'll take a look later this week. |
docs/layouts/shortcodes/generated/all_taskmanager_network_section.html
Outdated
Show resolved
Hide resolved
docs/layouts/shortcodes/generated/all_taskmanager_network_section.html
Outdated
Show resolved
Hide resolved
flink-core/src/main/java/org/apache/flink/configuration/NettyShuffleEnvironmentOptions.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/flink/runtime/io/network/api/writer/AdaptiveLoadBasedRecordWriter.java
Outdated
Show resolved
Hide resolved
...untime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriterBuilder.java
Outdated
Show resolved
Hide resolved
...untime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriterBuilder.java
Outdated
Show resolved
Hide resolved
b95259b to
750f38c
Compare
RocMarshal
left a comment
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 @davidradl for the review.
I updated the related lines based on your comments.
PTAL ~
docs/layouts/shortcodes/generated/all_taskmanager_network_section.html
Outdated
Show resolved
Hide resolved
docs/layouts/shortcodes/generated/all_taskmanager_network_section.html
Outdated
Show resolved
Hide resolved
...untime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriterBuilder.java
Outdated
Show resolved
Hide resolved
...untime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriterBuilder.java
Outdated
Show resolved
Hide resolved
flink-core/src/main/java/org/apache/flink/configuration/NettyShuffleEnvironmentOptions.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/flink/runtime/io/network/api/writer/AdaptiveLoadBasedRecordWriter.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/flink/runtime/io/network/api/writer/AdaptiveLoadBasedRecordWriter.java
Outdated
Show resolved
Hide resolved
| public void broadcastEmit(T record) throws IOException { | ||
| checkErroneous(); | ||
|
|
||
| // Emitting to all channels in a for loop can be better than calling |
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.
when you say can be better, when is it not?
I am curious what the overhead is for ResultPartitionWriter#broadcastRecord as we are in a method called broadcastEmit so I was expecting a broadcast implementation
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.
Hi, @davidradl As the comments lines before the method.
/** Copy from {@link ChannelSelectorRecordWriter#broadcastEmit}. */.
I just kept the original lines as most as possible.
flink-core/src/main/java/org/apache/flink/configuration/NettyShuffleEnvironmentOptions.java
Outdated
Show resolved
Hide resolved
flink-core/src/main/java/org/apache/flink/configuration/NettyShuffleEnvironmentOptions.java
Show resolved
Hide resolved
| bytesPerPartition.put(1, 3L); | ||
| bytesPerPartition.put(2, 1L); | ||
| assertThat(adaptiveLoadBasedRecordWriter.getTheIdlestChannelIndex()).isEqualTo(2); | ||
| } |
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.
Looking at test coverage, could we have a test for
- the zero bytes case
- setting different maxTraverseSizes in the config.
- flush all vs not flush all
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 zero bytes case
setting different maxTraverseSizes in the config.
Sounds good to me .update.
flush all vs not flush all
The test case is ignored to avoid redundant testing, Because the current change is not about the flush performance. It's about the channels selection before flushing.
So, I introduced the benchmark testing in the related sub-jira .
WDYTA?
| } | ||
|
|
||
| @VisibleForTesting | ||
| int getTheIdlestChannelIndex() { |
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 suggest not having The in the method name as it is superfluous to the meaning. If you like you could call it getMostIdle; just a suggestion.
…lePartitioner & RebalancePartitioner
54ae4fb to
9b62a25
Compare
| } | ||
|
|
||
| public RecordWriterBuilder<T> setMaxTraverseSize(int maxTraverseSize) { | ||
| Preconditions.checkArgument( |
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.
RYI: I reverted this change for testing purposes.
What is the purpose of the change
[FLINK-38943][runtime] Support Adaptive Partition Selection for RescalePartitioner and RebalancePartitioner
Brief change log
Introduce the following:
Verifying this change
This change added tests and can be verified as follows:
The benchmark about it is here
Does this pull request potentially affect one of the following parts:
@Public(Evolving): (yes / no)Documentation