Skip to content

IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean#12735

Open
abashev wants to merge 6 commits intoapache:masterfrom
abashev:feature/IGNITE-27827
Open

IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean#12735
abashev wants to merge 6 commits intoapache:masterfrom
abashev:feature/IGNITE-27827

Conversation

@abashev
Copy link

@abashev abashev commented Feb 13, 2026

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

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached 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.

this.depMode = depMode;
this.userVer = userVer;
this.participants = participants;
this.participants = Map.copyOf(participants);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should we keep extra map in java heap?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is best practice for all transport protocols if you send some object from one JVM to another then need to keep it immutable as much as possible. And this one is a protection from modifying internal map and also break down a connection with original map. Up to you, if you are fine without it then I'll remove it.

depMode = dep.deployMode();
userVer = dep.userVersion();
participants = dep.participants();
participants = Map.copyOf(dep.participants());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should we keep extra map in java heap?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⬆️

/**
* @param clsLdrId Class loader ID.
*/
public void classLoaderId(IgniteUuid clsLdrId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to keep each particular getter and setter near each other:
field1 {}
field1(field1) {}
field2() {}
field2(field2) {}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

/** */
private static final long serialVersionUID = 0L;

public class GridDeploymentInfoBean implements Message, GridDeploymentInfo {
Copy link
Contributor

@shishkovilja shishkovilja Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you checked that we can safely remove Externalizable? This class can be used in other Serializable classes, and removal will lead to errors in such cases.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did rollback for changes. I thought for RU we are removing all unversioned serializations 🤷‍♂️

@@ -0,0 +1,121 @@
package org.apache.ignite.internal.managers.deployment;
Copy link
Contributor

@shishkovilja shishkovilja Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing license header here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

/**
* Tests for {@link GridDeploymentInfoBean} serialization.
*/
public class GridDeploymentInfoBeanTest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such "per-message" approach seems to be very expensive. Take into account, that we have more than 300 messages, many of them have more than 10 fields.

Moreover, there are IgniteIoCommunicationMessageSerializationTest. It doesn't test different values, but it tests serialization consitency.

Also, there are integration test for continuous queries, etc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is cheap right now - if you need I can add tests for all other messages. This is raw junit without external dependencies so just a few milliseconds to overall report.

private DeploymentMode depMode;

/** */
@Order(value = 4, method = "userVersion")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep uniformely ascending order.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@sonarqubecloud
Copy link

abashev and others added 2 commits February 13, 2026 17:41
…/deployment/GridDeploymentInfoBean.java

Co-authored-by: Ilya Shishkov <shishkovilja@gmail.com>
@abashev abashev requested a review from shishkovilja February 13, 2026 16:35
@abashev abashev force-pushed the feature/IGNITE-27827 branch from 5cbdea1 to 9e637d4 Compare February 13, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants