[
https://issues.apache.org/jira/browse/FLINK-9913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16555487#comment-16555487
]
ASF GitHub Bot commented on FLINK-9913:
---------------------------------------
GitHub user zhijiangW opened a pull request:
https://github.com/apache/flink/pull/6417
[FLINK-9913][runtime] Improve output serialization only once in RecordWriter
## What is the purpose of the change
*This pull request improves the output serialization only once for multi
target channels in `RecordWriter`, rather than serialization as many times as
the number of selected channels.
## Brief change log
- *Only one `RecordSerializer` is created for all the output channels in
`RecordWriter`*
- *Restructure the processes of `emit`, `broadcastEmit`, randomEmit` in
`RecordWriter`*
- *Restructure the interface methods in `RecordSerializer`*
## Verifying this change
This change is already covered by existing tests, such as
*SpanningRecordSerializationTest*, etc.
And adds new tests in `RecordWriterTest` to verify:
- *The serialization results are correct by `RecordWriter#emit` with
`BroadcastPartitioner`*
- *The serialization results are correct by `RecordWriter#broadcastEmit`
directly*
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (no)
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: (no)
- The serializers: (yes)
- The runtime per-record code paths (performance sensitive): (yes)
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zhijiangW/flink FLINK-9913
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/6417.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #6417
----
commit 109ddb37abafcea28478b90cda10b965e0c399d5
Author: Zhijiang <wangzhijiang999@...>
Date: 2018-07-25T05:45:23Z
[FLINK-9913][runtime] Improve output serialization only once in RecordWriter
----
> 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.6.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 channels.
> # The intermediate serialization results are copied into different
> {{BufferBuilder}}s for different channels.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)