Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Proposed changes

Message DTO

  1. Message#writeToMessageWriter, Message#readFrom MessageReader logic is depends on a remote IgniteProductVersion.
  2. Message#writeTo, Message#readFrom is auto-generated and stored separately from Message DTO classes.
  3. Message fields contain:
    1. primitive classes
    2. known collections
    3. POJO - that are other Message
    4. Users classes and java functions (e.g. ComputeJob), that will be serialized with JdkMarshaller
    5. byte[] fields (objects serialized externally) must be avoided as much as possible, because their compatibility can't be guaranteed
  4. Add @Since, @Until  annotations for Message classes and fields.

...

Message - is base class for all messages transported between nodes. Proposed changes:

  1. Message#writeTo consumes IgniteProductVersion MessageWriter that stores IgniteProduceVersion of destination node and use it for serializing data for this version (mostly, for ignoring some fields).
  2. Message#readFrom consumes MessageReader that stores IgniteProductVersion of source node and use it for deserializing data (mostly, for setting default values of new fields).

    Code Block
    languagejava
    titleMessage
    public interface Message {    
        public boolean writeTo(ByteBuffer buf, MessageWriter writer, IgniteProductVersion destVer);
    
        public boolean readFrom(ByteBuffer buf, MessageReader reader, IgniteProductVersion srcVer);
    
        public short directType();
    }


  3. Introduce annotations @Since and @Until for Message classes and Message fields, to use it for generating code for Message#writeTo and Message#readFrom:

...