You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Piotr Nowojski (Jira)" <ji...@apache.org> on 2020/12/29 10:30:00 UTC

[jira] [Closed] (FLINK-17331) Add NettyMessageContent interface for all the class which could be write to NettyMessage

     [ https://issues.apache.org/jira/browse/FLINK-17331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Piotr Nowojski closed FLINK-17331.
----------------------------------
    Fix Version/s: 1.13.0
       Resolution: Fixed

merged commit 96d8c0d into master

> Add NettyMessageContent interface for all the class which could be write to NettyMessage
> ----------------------------------------------------------------------------------------
>
>                 Key: FLINK-17331
>                 URL: https://issues.apache.org/jira/browse/FLINK-17331
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / Network
>            Reporter: Yangze Guo
>            Assignee: Yangze Guo
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.13.0
>
>
> Currently, there are some classes, e.g. {{JobVertexID}}, {{ExecutionAttemptID}} need to write to {{NettyMessage}}. However, the size of these classes in {{ByteBuf}} are directly written in {{NettyMessage}} class, which is error-prone. If someone edits those classes, there would be no warning or error during the compile phase. I think it would be better to add a {{NettyMessageContent}}(the name could be discussed) interface:
> {code:java}
> public interface NettyMessageContent {
>     void writeTo(ByteBuf bug)
>     int getContentLen();
> }
> {code}
> Regarding the {{fromByteBuf}}, since it is a static method, we could not add it to the interface. We might explain it in the javaDoc of {{NettyMessageContent}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)