pnowojski commented on a change in pull request #7199: [FLINK-10662][network]
Refactor the ChannelSelector interface for single selected channel
URL: https://github.com/apache/flink/pull/7199#discussion_r250971373
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java
##########
@@ -68,20 +68,29 @@
private final boolean flushAlways;
+ private final boolean isBroadcastSelector;
+
private Counter numBytesOut = new SimpleCounter();
private Counter numBuffersOut = new SimpleCounter();
public RecordWriter(ResultPartitionWriter writer) {
- this(writer, new RoundRobinChannelSelector<T>());
+ this(writer, new RoundRobinChannelSelector<T>(), false);
}
- @SuppressWarnings("unchecked")
- public RecordWriter(ResultPartitionWriter writer, ChannelSelector<T>
channelSelector) {
- this(writer, channelSelector, false);
+ public RecordWriter(
Review comment:
`instanceof BroadcastPartitioner` sounds like a hack, not a proper solution.
In the short term I would vote for `ChannelSelector#isBroadcast`.
Maybe in the long term a better solution would be to introduce some kind of
`ChannelSelectorBuilder` or `ChannelSelectorDescriptor`, which is used to
create correct `RecordWriter` and `ChannelSelector`. It could also solve the
issue of `BroadcastPartitioner#selectChannel()` throwing
`UnsupportedOperationException` which is also ugly :( ). But I'm not sure if
that's the best solution and I don't think it's worth doing yet another
refactor here now.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services