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

    https://github.com/apache/flink/pull/4518#discussion_r136834211
  
    --- 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 --
    
    `buffer.nioBuffer(buffer.readerIndex(), length);` ?


---

Reply via email to