[ 
https://issues.apache.org/jira/browse/IGNITE-28938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anton Vinogradov updated IGNITE-28938:
--------------------------------------
    Description: 
*No wire format change.*

h3. Goal

Do not give a marshaller to messages that only need a callback before send.

h3. Why

{{MarshallableMessage}} is used for two different things. 12 of its 21 
implementations really use the marshaller. The other 8 use neither the 
marshaller nor the class loader - they only change their own fields:
* {{CacheContinuousQueryEntry}} - clears data;
* {{GridCacheEntryInfo}} - recalculates TTL;
* {{GridDhtPartitionsFullMessage}} and {{GridDhtPartitionsSingleMessage}} - 
copy and zip partition maps;
* {{GridNearTxPrepareRequest}} - sets an expiry policy flag;
* {{ColocationGroup}} - packs bits;
* {{CompressedMessage}} and {{GridH2ValueMessage}}.

All 8 still get a {{Marshaller}} field in the generated companion.

h3. How

* add a new interface for the callback, with no marshaller and no class loader;
* move these 8 classes to it, so the generator calls the callback instead of 
{{msg.marshal(marshaller)}};
* keep {{MarshallableMessage}} for the other 12.

h3. Expected result

The type now shows if a class needs a marshaller. 8 companions lose the field. 
{{GridTestUtils#loadMarshaller}} becomes correct again: it picks a constructor 
by {{instanceof MarshallableMessage}}, while the generator uses {{marshallable 
|| hasMarshalled}}.

h3. How to verify

Full build and the message tests. Generated code of these 8 classes must stay 
the same, except the removed field.

  was:
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.

        Summary: Split MarshallableMessage: callback before send vs marshalling 
 (was: Split MarshallableMessage into a pre-marshal hook and a marshalling 
contract)

> Split MarshallableMessage: callback before send vs marshalling
> --------------------------------------------------------------
>
>                 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
>            Priority: Major
>             Fix For: 2.19
>
>
> *No wire format change.*
> h3. Goal
> Do not give a marshaller to messages that only need a callback before send.
> h3. Why
> {{MarshallableMessage}} is used for two different things. 12 of its 21 
> implementations really use the marshaller. The other 8 use neither the 
> marshaller nor the class loader - they only change their own fields:
> * {{CacheContinuousQueryEntry}} - clears data;
> * {{GridCacheEntryInfo}} - recalculates TTL;
> * {{GridDhtPartitionsFullMessage}} and {{GridDhtPartitionsSingleMessage}} - 
> copy and zip partition maps;
> * {{GridNearTxPrepareRequest}} - sets an expiry policy flag;
> * {{ColocationGroup}} - packs bits;
> * {{CompressedMessage}} and {{GridH2ValueMessage}}.
> All 8 still get a {{Marshaller}} field in the generated companion.
> h3. How
> * add a new interface for the callback, with no marshaller and no class 
> loader;
> * move these 8 classes to it, so the generator calls the callback instead of 
> {{msg.marshal(marshaller)}};
> * keep {{MarshallableMessage}} for the other 12.
> h3. Expected result
> The type now shows if a class needs a marshaller. 8 companions lose the 
> field. {{GridTestUtils#loadMarshaller}} becomes correct again: it picks a 
> constructor by {{instanceof MarshallableMessage}}, while the generator uses 
> {{marshallable || hasMarshalled}}.
> h3. How to verify
> Full build and the message tests. Generated code of these 8 classes must stay 
> the same, except the removed field.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to