Anton Vinogradov created IGNITE-28938:
-----------------------------------------
Summary: Split MarshallableMessage into a pre-marshal hook and a
marshalling contract
Key: IGNITE-28938
URL: https://issues.apache.org/jira/browse/IGNITE-28938
Project: Ignite
Issue Type: Sub-task
Components: messaging
Reporter: Anton Vinogradov
Assignee: Anton Vinogradov
Fix For: 2.19
h3. Goal
Stop handing a marshaller to messages that only need a "prepare before send"
callback.
h3. Why
{{MarshallableMessage}} means two different things today. Of its 21
implementations in main, 12 really call the marshaller and 8 use neither it nor
the class loader - they only reshape their own fields:
{{CacheContinuousQueryEntry}} (data reset), {{GridCacheEntryInfo}} (TTL
recalculation), {{GridDhtPartitionsFullMessage}} and
{{GridDhtPartitionsSingleMessage}} (partition map copy/zip),
{{GridNearTxPrepareRequest}} (expiry policy flag), {{ColocationGroup}} (bit
packing), {{CompressedMessage}}, {{GridH2ValueMessage}}. All 8 still receive a
{{Marshaller}} field in their generated companion.
h3. How
* introduce a hook interface whose signature has neither a marshaller nor a
class loader;
* move the 8 classes to it; the generator emits the hook call instead of
{{msg.marshal(marshaller)}};
* keep {{MarshallableMessage}} for the remaining 12.
h3. Expected result
"Needs a marshaller" becomes readable from the type. 8 companions lose their
{{Marshaller}} field, and the criterion in {{GridTestUtils#loadMarshaller}} -
which picks a constructor by {{instanceof MarshallableMessage}} while the
generator emits {{ctor(Marshaller)}} for {{marshallable || hasMarshalled}} -
becomes correct again.
h3. How to verify
Full compile plus the message tests; the generated bodies of the 8 classes must
be unchanged apart from the removed field.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)