flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-9913) Improve output serialization only once in RecordWriter
Date Mon, 27 Aug 2018 13:52:04 GMT

    [ https://issues.apache.org/jira/browse/FLINK-9913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16593683#comment-16593683

ASF GitHub Bot commented on FLINK-9913:

NicoK commented on a change in pull request #6417: [FLINK-9913][runtime] Improve output serialization
only once in RecordWriter
URL: https://github.com/apache/flink/pull/6417#discussion_r212980692

 File path: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/writer/RecordWriterTest.java
 @@ -524,6 +615,31 @@ public void read(DataInputView in) throws IOException {
+	/**
+	 * Broadcast channel selector that selects all the output channels.
+	 */
+	private static class Broadcast<T extends IOReadableWritable> implements ChannelSelector<T>
+		private int[] returnChannel;
+		boolean set;
 Review comment:
   Actually, this is a copy of `org.apache.flink.streaming.runtime.partitioner.BroadcastPartitioner`
which is in the `flink-streaming-java` submodule, though.
   And in general it is good to cache this rather than building a new array for every record...
   Using `returnChannel.length == numberOfOutputChannels` makes sense though - @zhijiangW
can you also create a hotfix commit changing this in `org.apache.flink.streaming.runtime.partitioner.BroadcastPartitioner`?

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:

> Improve output serialization only once in RecordWriter
> ------------------------------------------------------
>                 Key: FLINK-9913
>                 URL: https://issues.apache.org/jira/browse/FLINK-9913
>             Project: Flink
>          Issue Type: Improvement
>          Components: Network
>    Affects Versions: 1.6.0
>            Reporter: zhijiang
>            Assignee: zhijiang
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.7.0
> Currently the {{RecordWriter}} emits output into multi channels via {{ChannelSelector}} 
or broadcasts output to all channels directly. Each channel has a separate {{RecordSerializer}}
for serializing outputs, that means the output will be serialized as many times as the number
of selected channels.
> As we know, data serialization is a high cost operation, so we can get good benefits
by improving the serialization only once.
> I would suggest the following changes for realizing it.
>  # Only one {{RecordSerializer}} is created in {{RecordWriter}} for all the channels.
>  # The output is serialized into the intermediate data buffer only once for different
>  # The intermediate serialization results are copied into different {{BufferBuilder}}s
for different channels.

This message was sent by Atlassian JIRA

View raw message