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

[jira] [Updated] (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 ]

Robert Metzger updated FLINK-17331:
-----------------------------------
    Component/s: Runtime / Network

> 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
>            Priority: Minor
>
> 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)