IGNITE-26646 Use MessageSerializer for PartitionUpdateCountersMessage#12402
IGNITE-26646 Use MessageSerializer for PartitionUpdateCountersMessage#12402shishkovilja merged 5 commits intoapache:masterfrom
Conversation
42034b2 to
3f54423
Compare
2aac42e to
8bbcce0
Compare
| if (data == null) | ||
| return new byte[0]; |
There was a problem hiding this comment.
IgniteIoCommunicationMessageSerializationTest#testMessageSerializationAndDeserializationConsistency fails without null check
There was a problem hiding this comment.
Based on the fact that data is initialized in the constructor and cannot be null, I suggest removing this check and adding to IgniteIoCommunicationMessageSerializationTest#initializeMessage:
if (msg instanceof PartitionUpdateCountersMessage)
FieldUtils.writeField(msg, "data", new byte[0], true);
| */ | ||
| public void payload(byte[] payload) { | ||
| data = payload; | ||
| size = data == null ? 0 : data.length / ITEM_SIZE; |
There was a problem hiding this comment.
IgniteCachePutGetRestartAbstractTest#testTxPutGetRestart fails without null check
There was a problem hiding this comment.
MessageReader#readByteArray returns null when it couldn't fully extract the entire payload from the buffer because the complete byte array didn't fit into the read buffer.
Previously, we were setting the size after successfully reading the whole byte array using the reader.
In my opinion, the current logic seems fine.
.../apache/ignite/internal/processors/cache/distributed/dht/PartitionUpdateCountersMessage.java
Outdated
Show resolved
Hide resolved
.../apache/ignite/internal/processors/cache/distributed/dht/PartitionUpdateCountersMessage.java
Outdated
Show resolved
Hide resolved
.../apache/ignite/internal/processors/cache/distributed/dht/PartitionUpdateCountersMessage.java
Show resolved
Hide resolved
...he/ignite/internal/managers/communication/IgniteIoCommunicationMessageSerializationTest.java
Show resolved
Hide resolved
.../apache/ignite/internal/processors/cache/distributed/dht/PartitionUpdateCountersMessage.java
Outdated
Show resolved
Hide resolved
.../apache/ignite/internal/processors/cache/distributed/dht/PartitionUpdateCountersMessage.java
Outdated
Show resolved
Hide resolved
.../apache/ignite/internal/processors/cache/distributed/dht/PartitionUpdateCountersMessage.java
Show resolved
Hide resolved
…niteIoCommunicationMessageSerializationTest#testMessageSerializationAndDeserializationConsistency
…ssageSerializationAndDeserializationConsistency
a3890db to
f699797
Compare
f699797 to
97c0519
Compare
|



Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summarywhereXXXX- number of JIRA issue.(see the Maintainers list)
the
green visaattached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.