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

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

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

    https://github.com/apache/flink/pull/4518#discussion_r141373324
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyMessage.java
 ---
    @@ -440,12 +440,11 @@ ByteBuf write(ByteBufAllocator allocator) throws 
IOException {
                static TaskEventRequest readFrom(ByteBuf buffer, ClassLoader 
classLoader) throws IOException {
                        TaskEventRequest result = new TaskEventRequest();
     
    -                   // TODO Directly deserialize fromNetty's buffer
    +                   // directly deserialize fromNetty's buffer
                        int length = buffer.readInt();
    -                   ByteBuffer serializedEvent = 
ByteBuffer.allocate(length);
    -
    -                   buffer.readBytes(serializedEvent);
    -                   serializedEvent.flip();
    +                   ByteBuffer serializedEvent = buffer.nioBuffer();
    --- End diff --
    
    yes, makes sense to change this as an additional safeguard


> optimise NettyMessage.TaskEventRequest#readFrom() to read from netty buffers 
> directly
> -------------------------------------------------------------------------------------
>
>                 Key: FLINK-7412
>                 URL: https://issues.apache.org/jira/browse/FLINK-7412
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Network
>    Affects Versions: 1.4.0
>            Reporter: Nico Kruber
>            Assignee: Nico Kruber
>
> {{NettyMessage.TaskEventRequest#readFrom()}} allocates a new {{ByteBuffer}} 
> for event deserialization although, here, we are easily able to read from 
> netty's buffer directly



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

Reply via email to