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

ASF GitHub Bot commented on FLINK-7746:
---------------------------------------

Github user pnowojski commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4759#discussion_r148553146
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartition.java
 ---
    @@ -293,6 +293,27 @@ public void add(Buffer buffer, int subpartitionIndex) 
throws IOException {
        }
     
        /**
    +    * Writes the given buffer to all available target channels.
    +    *
    +    * <p>The buffer is taken over and used for each of the channels. It 
will be recycled afterwards.
    +    *
    +    * @param buffer the buffer to write
    +    */
    +   public void addToAllChannels(Buffer buffer) throws IOException {
    +           try {
    +                   for (int targetChannel = 0; targetChannel < 
subpartitions.length; targetChannel++) {
    +                           // retain the buffer so that it can be recycled 
by each channel of targetPartition
    +                           buffer.retain();
    --- End diff --
    
    very nitty nit: I would inline this `add(buffer.retain(), tergetChannel)`


> move ResultPartitionWriter#writeBufferToAllChannels up into ResultPartition
> ---------------------------------------------------------------------------
>
>                 Key: FLINK-7746
>                 URL: https://issues.apache.org/jira/browse/FLINK-7746
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Network
>    Affects Versions: 1.4.0
>            Reporter: Nico Kruber
>            Assignee: Nico Kruber
>            Priority: Major
>
> As a step towards removing the (unneeded) {{ResultPartitionWriter}} wrapper, 
> we should move {{ResultPartitionWriter#writeBufferToAllChannels}} into 
> {{ResultPartition}} where single-channel writing happens anyway.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to