Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-14081 Networking module
  3. IGNITE-14649

Create an annotation processor for generating message serializers and de-serializers

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha2
    • networking
    • None

    Description

      NetworkMessage instances can be (de-)serialized using instances of MessageSerializer and MessageDeserializer interfaces. These interfaces have to be implemented for every message type which is very tedious and can be automated. It is proposed to use annotation processing to generate the corresponding implementations for every network message.

      Current serialization procedure looks like the following:

      1. Message header is written.
      2. Message fields are sorted alphanumerically. This is done for historical reasons and not needed at the moment, but it was decided to keep this logic.
      3. Message fields are dumped into the provided stateful MessageWriter.

      De-serialization procedure performs the same actions in reverse order.

      Requirements

      1. Create an annotation processor for generating instances of the following interfaces:
        1. MessageDeserializer
        2. MessageSerializer
        3. MessageSerializationFactory
      2. Introduce the @AutoSerializable annotation that will be used to mark NetworkMessage implementations which will be considered as candidates for code generation by the annotation processor.
      3. It should be possible to implement custom (de-)serializers for some messages. In this case it is proposed to simply omit the @AutoSerializable annotation on such messages.
      4. Auto-generated MessageSerializationFactory instances should be automatically registered in a MessageSerializationRegistry. It is proposed to create a helper class that will add the generated factories to the provided registry.

      Attachments

        Issue Links

          Activity

            People

              apolovtcev Aleksandr Polovtsev
              sdanilov Semyon Danilov
              Semyon Danilov Semyon Danilov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 5h 20m
                  5h 20m