You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/09/04 14:36:00 UTC
[jira] [Commented] (FLINK-7412) optimise
NettyMessage.TaskEventRequest#readFrom() to read from netty buffers
directly
[ https://issues.apache.org/jira/browse/FLINK-7412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16152668#comment-16152668 ]
ASF GitHub Bot commented on FLINK-7412:
---------------------------------------
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);` ?
> 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)