Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-17331

Add NettyMessageContent interface for all the class which could be write to NettyMessage

    XMLWordPrintableJSON

Details

    Description

      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:

      public interface NettyMessageContent {
          void writeTo(ByteBuf bug)
          int getContentLen();
      }
      

      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.

      Attachments

        Issue Links

          Activity

            People

              guoyangze Yangze Guo
              guoyangze Yangze Guo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: