Hi Igniters,

I propose new rules and infrastructure around working with Message classes.
This work is being doing for IEP-132 Rolling Upgrade [1], [2].

Previously, we had an optional code generator for Message#writeTo,
Message#readFrom code. I'm propose a patch [3] which makes the generation
mandatory and enforces it at compile time using javax.annotation.processor
[4] framework.

What's changing:

1. All Message classes must now follow strict rules.

   - Strict field ordering via @Order annotation.
   - Naming conventions (field/getter/setter alignment).
   - Type of fields must not be changed.

2. There are 2 steps for the rules validation: at compile time and during
PR checks.

3. Message#readFrom and Message#writeTo methods now are deprecated and will
be removed in the future. Instead, a [Message]Serializer class is generated
at compile time. Serializers must be registered in GridIoMessageFactory.

4. The ignite-core module now depends on the ignite-codegen2 module. This
is required because the framework needs a pre-compiled .jar for generation.

5. The ignite-codegen and ignite-codegen2 modules will be merged later,
after we refactor SystemViewRowAttributeWalkerGenerator to use the same
framework. For now, cyclic dependencies prevent using a single module for
both generators.

6. Binary representation of Message doesn't change. Then we will refactor
Message by Message in background.

The patch [3] includes an example for GridJobCancelRequest. Please take a
look. Thanks Sergey Chugunov for his contribution and efforts in the review.

Igniters, please share your thoughts. If no objections, I'll proceeding
with merging the patch on Friday, 4th of July.

[1]
https://cwiki.apache.org/confluence/display/IGNITE/IEP-132+Rolling+Upgrade
[2]
https://cwiki.apache.org/confluence/display/IGNITE/Communication+protocol
[3] https://github.com/apache/ignite/pull/12129
[4]
https://docs.oracle.com/en/java/javase/11/docs/api/java.compiler/javax/annotation/processing/package-summary.html

Reply via email to