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

Zhijiang commented on FLINK-17331:
----------------------------------

After offline discussing with [~karmagyz], i am aware of this motivation now.

While writing header for some NettyMessage instances into network stack, e.g. 
BufferResponse, the internal involved field length is hard coded inside 
NettyMessage. So if we make some changes for such field e.g. InputChannelID, 
then we are not ware that it also needs to change the respective length for 
related netty messages component. It would be better if we can make some 
dependence among them or find the inconsistency after changes early.

This improvement is not so critical and urgent, so feel free when you want to 
improve it a bit. [~karmagyz]

> 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
>
> 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)

Reply via email to