You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "abashev (via GitHub)" <gi...@apache.org> on 2026/02/13 07:04:18 UTC
[PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
abashev opened a new pull request, #12735:
URL: https://github.com/apache/ignite/pull/12735
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](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja commented on code in PR #12735:
URL: https://github.com/apache/ignite/pull/12735#discussion_r2803742850
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -18,46 +18,39 @@
package org.apache.ignite.internal.managers.deployment;
import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.nio.ByteBuffer;
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.configuration.DeploymentMode;
-import org.apache.ignite.internal.GridDirectMap;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.plugin.extensions.communication.Message;
-import org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
-import org.apache.ignite.plugin.extensions.communication.MessageReader;
-import org.apache.ignite.plugin.extensions.communication.MessageWriter;
/**
* Deployment info bean.
*/
-public class GridDeploymentInfoBean implements Message, GridDeploymentInfo, Externalizable {
- /** */
- private static final long serialVersionUID = 0L;
-
+public class GridDeploymentInfoBean implements Message, GridDeploymentInfo {
/** */
+ @Order(value = 0, method = "classLoaderId")
private IgniteUuid clsLdrId;
/** */
+ @Order(value = 1, method = "deployMode")
private DeploymentMode depMode;
/** */
+ @Order(value = 4, method = "userVersion")
private String userVer;
/** */
+ @Order(value = 2, method = "localDeploymentOwner")
@Deprecated // Left for backward compatibility only.
private boolean locDepOwner;
/** Node class loader participant map. */
@GridToStringInclude
- @GridDirectMap(keyType = UUID.class, valueType = IgniteUuid.class)
+ @Order(value = 3, method = "participants")
Review Comment:
When method and field contains same name, we can skip explicit method specifying.
```suggestion
@Order(3)
```
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -125,139 +118,55 @@ public GridDeploymentInfoBean(GridDeploymentInfo dep) {
return participants;
}
- /** {@inheritDoc} */
- @Override public int hashCode() {
- return clsLdrId.hashCode();
+ /**
+ * @param clsLdrId Class loader ID.
+ */
+ public void classLoaderId(IgniteUuid clsLdrId) {
Review Comment:
I suggest to keep each particular getter and setter near each other:
field1 {}
field1(field1) {}
field2() {}
field2(field2) {}
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -18,46 +18,39 @@
package org.apache.ignite.internal.managers.deployment;
import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.nio.ByteBuffer;
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.configuration.DeploymentMode;
-import org.apache.ignite.internal.GridDirectMap;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.plugin.extensions.communication.Message;
-import org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
-import org.apache.ignite.plugin.extensions.communication.MessageReader;
-import org.apache.ignite.plugin.extensions.communication.MessageWriter;
/**
* Deployment info bean.
*/
-public class GridDeploymentInfoBean implements Message, GridDeploymentInfo, Externalizable {
- /** */
- private static final long serialVersionUID = 0L;
-
+public class GridDeploymentInfoBean implements Message, GridDeploymentInfo {
Review Comment:
Have you checked that we can safely remove `Externalizable`? This class can be used in other `Serializable` classed, and removal will lead to errors.
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -82,7 +75,7 @@ public GridDeploymentInfoBean(
this.clsLdrId = clsLdrId;
this.depMode = depMode;
this.userVer = userVer;
- this.participants = participants;
+ this.participants = Map.copyOf(participants);
Review Comment:
Why should we keep extra map in java heap?
##########
modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBeanTest.java:
##########
@@ -0,0 +1,121 @@
+package org.apache.ignite.internal.managers.deployment;
Review Comment:
Misssing license header here.
##########
modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBeanTest.java:
##########
@@ -0,0 +1,121 @@
+package org.apache.ignite.internal.managers.deployment;
+
+import static java.util.UUID.randomUUID;
+import static org.apache.ignite.lang.IgniteUuid.randomUuid;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.nio.ByteBuffer;
+import java.util.Map;
+import java.util.function.Function;
+import org.apache.ignite.configuration.DeploymentMode;
+import org.apache.ignite.internal.direct.DirectMessageReader;
+import org.apache.ignite.internal.direct.DirectMessageWriter;
+import org.apache.ignite.internal.managers.communication.GridIoMessageFactory;
+import org.apache.ignite.internal.managers.communication.IgniteMessageFactoryImpl;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.plugin.extensions.communication.MessageFactory;
+import org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider;
+import org.apache.ignite.plugin.extensions.communication.MessageSerializer;
+import org.junit.Test;
+
+/**
+ * Tests for {@link GridDeploymentInfoBean} serialization.
+ */
+public class GridDeploymentInfoBeanTest {
Review Comment:
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.
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -92,7 +85,7 @@ public GridDeploymentInfoBean(GridDeploymentInfo dep) {
clsLdrId = dep.classLoaderId();
depMode = dep.deployMode();
userVer = dep.userVersion();
- participants = dep.participants();
+ participants = Map.copyOf(dep.participants());
Review Comment:
Why should we keep extra map in java heap?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "abashev (via GitHub)" <gi...@apache.org>.
abashev commented on code in PR #12735:
URL: https://github.com/apache/ignite/pull/12735#discussion_r2805085993
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -125,139 +118,55 @@ public GridDeploymentInfoBean(GridDeploymentInfo dep) {
return participants;
}
- /** {@inheritDoc} */
- @Override public int hashCode() {
- return clsLdrId.hashCode();
+ /**
+ * @param clsLdrId Class loader ID.
+ */
+ public void classLoaderId(IgniteUuid clsLdrId) {
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja commented on code in PR #12735:
URL: https://github.com/apache/ignite/pull/12735#discussion_r2804172334
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -18,46 +18,39 @@
package org.apache.ignite.internal.managers.deployment;
import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.nio.ByteBuffer;
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.configuration.DeploymentMode;
-import org.apache.ignite.internal.GridDirectMap;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.plugin.extensions.communication.Message;
-import org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
-import org.apache.ignite.plugin.extensions.communication.MessageReader;
-import org.apache.ignite.plugin.extensions.communication.MessageWriter;
/**
* Deployment info bean.
*/
-public class GridDeploymentInfoBean implements Message, GridDeploymentInfo, Externalizable {
- /** */
- private static final long serialVersionUID = 0L;
-
+public class GridDeploymentInfoBean implements Message, GridDeploymentInfo {
/** */
+ @Order(value = 0, method = "classLoaderId")
private IgniteUuid clsLdrId;
/** */
+ @Order(value = 1, method = "deployMode")
private DeploymentMode depMode;
/** */
+ @Order(value = 4, method = "userVersion")
Review Comment:
Let's keep uniformely ascending order.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12735:
URL: https://github.com/apache/ignite/pull/12735#issuecomment-3919776119
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12735) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12735&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12735&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12735&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12735&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12735&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12735)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "abashev (via GitHub)" <gi...@apache.org>.
abashev commented on code in PR #12735:
URL: https://github.com/apache/ignite/pull/12735#discussion_r2804960386
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -18,46 +18,39 @@
package org.apache.ignite.internal.managers.deployment;
import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.nio.ByteBuffer;
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.configuration.DeploymentMode;
-import org.apache.ignite.internal.GridDirectMap;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.plugin.extensions.communication.Message;
-import org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
-import org.apache.ignite.plugin.extensions.communication.MessageReader;
-import org.apache.ignite.plugin.extensions.communication.MessageWriter;
/**
* Deployment info bean.
*/
-public class GridDeploymentInfoBean implements Message, GridDeploymentInfo, Externalizable {
- /** */
- private static final long serialVersionUID = 0L;
-
+public class GridDeploymentInfoBean implements Message, GridDeploymentInfo {
Review Comment:
I did rollback for changes. I thought for RU we are removing all unversioned serializations 🤷♂️
##########
modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBeanTest.java:
##########
@@ -0,0 +1,121 @@
+package org.apache.ignite.internal.managers.deployment;
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12735:
URL: https://github.com/apache/ignite/pull/12735#issuecomment-3913902779
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12735) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12735&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12735&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12735&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12735&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12735&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12735)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "abashev (via GitHub)" <gi...@apache.org>.
abashev closed pull request #12735: IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean
URL: https://github.com/apache/ignite/pull/12735
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja commented on code in PR #12735:
URL: https://github.com/apache/ignite/pull/12735#discussion_r2816279496
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -42,24 +38,38 @@ public class GridDeploymentInfoBean implements Message, GridDeploymentInfo, Exte
/** */
private static final long serialVersionUID = 0L;
- /** */
+ /**
+ *
Review Comment:
Purpose of changes?
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -42,24 +38,38 @@ public class GridDeploymentInfoBean implements Message, GridDeploymentInfo, Exte
/** */
private static final long serialVersionUID = 0L;
- /** */
+ /**
+ *
+ */
+ @Order(value = 0, method = "classLoaderId")
private IgniteUuid clsLdrId;
- /** */
+ /**
+ *
+ */
+ @Order(value = 1, method = "deployMode")
private DeploymentMode depMode;
- /** */
- private String userVer;
-
- /** */
+ /**
+ *
Review Comment:
Purpose of changes?
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -68,9 +78,9 @@ public GridDeploymentInfoBean() {
}
/**
- * @param clsLdrId Class loader ID.
- * @param userVer User version.
- * @param depMode Deployment mode.
+ * @param clsLdrId Class loader ID.
Review Comment:
Purpose of changes?
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -68,9 +78,9 @@ public GridDeploymentInfoBean() {
}
/**
- * @param clsLdrId Class loader ID.
- * @param userVer User version.
- * @param depMode Deployment mode.
+ * @param clsLdrId Class loader ID.
+ * @param userVer User version.
Review Comment:
Purpose of changes?
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -42,24 +38,38 @@ public class GridDeploymentInfoBean implements Message, GridDeploymentInfo, Exte
/** */
private static final long serialVersionUID = 0L;
- /** */
+ /**
+ *
+ */
+ @Order(value = 0, method = "classLoaderId")
private IgniteUuid clsLdrId;
- /** */
+ /**
+ *
+ */
+ @Order(value = 1, method = "deployMode")
private DeploymentMode depMode;
- /** */
- private String userVer;
-
- /** */
+ /**
+ *
+ */
+ @Order(value = 2, method = "localDeploymentOwner")
@Deprecated // Left for backward compatibility only.
private boolean locDepOwner;
- /** Node class loader participant map. */
+ /**
+ * Node class loader participant map.
+ */
@GridToStringInclude
- @GridDirectMap(keyType = UUID.class, valueType = IgniteUuid.class)
+ @Order(3)
private Map<UUID, IgniteUuid> participants;
+ /**
+ *
Review Comment:
Purpose of changes?
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -68,9 +78,9 @@ public GridDeploymentInfoBean() {
}
/**
- * @param clsLdrId Class loader ID.
- * @param userVer User version.
- * @param depMode Deployment mode.
+ * @param clsLdrId Class loader ID.
+ * @param userVer User version.
+ * @param depMode Deployment mode.
Review Comment:
Purpose of changes?
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -42,24 +38,38 @@ public class GridDeploymentInfoBean implements Message, GridDeploymentInfo, Exte
/** */
private static final long serialVersionUID = 0L;
- /** */
+ /**
+ *
+ */
+ @Order(value = 0, method = "classLoaderId")
private IgniteUuid clsLdrId;
- /** */
+ /**
+ *
+ */
+ @Order(value = 1, method = "deployMode")
private DeploymentMode depMode;
- /** */
- private String userVer;
-
- /** */
+ /**
+ *
+ */
+ @Order(value = 2, method = "localDeploymentOwner")
@Deprecated // Left for backward compatibility only.
private boolean locDepOwner;
- /** Node class loader participant map. */
+ /**
+ * Node class loader participant map.
Review Comment:
Purpose of changes?
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -42,24 +38,38 @@ public class GridDeploymentInfoBean implements Message, GridDeploymentInfo, Exte
/** */
private static final long serialVersionUID = 0L;
- /** */
+ /**
+ *
+ */
+ @Order(value = 0, method = "classLoaderId")
private IgniteUuid clsLdrId;
- /** */
+ /**
+ *
Review Comment:
Purpose of changes?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12735:
URL: https://github.com/apache/ignite/pull/12735#issuecomment-3897203182
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12735) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12735&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12735&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12735&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12735&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12735&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12735)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja commented on code in PR #12735:
URL: https://github.com/apache/ignite/pull/12735#discussion_r2803809777
##########
modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBeanTest.java:
##########
@@ -0,0 +1,121 @@
+package org.apache.ignite.internal.managers.deployment;
Review Comment:
Missing license header here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12735:
URL: https://github.com/apache/ignite/pull/12735#issuecomment-3915352138
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12735) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12735&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12735&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12735&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12735&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12735&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12735)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja commented on code in PR #12735:
URL: https://github.com/apache/ignite/pull/12735#discussion_r2803769013
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -18,46 +18,39 @@
package org.apache.ignite.internal.managers.deployment;
import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.nio.ByteBuffer;
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.configuration.DeploymentMode;
-import org.apache.ignite.internal.GridDirectMap;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.plugin.extensions.communication.Message;
-import org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
-import org.apache.ignite.plugin.extensions.communication.MessageReader;
-import org.apache.ignite.plugin.extensions.communication.MessageWriter;
/**
* Deployment info bean.
*/
-public class GridDeploymentInfoBean implements Message, GridDeploymentInfo, Externalizable {
- /** */
- private static final long serialVersionUID = 0L;
-
+public class GridDeploymentInfoBean implements Message, GridDeploymentInfo {
Review Comment:
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "abashev (via GitHub)" <gi...@apache.org>.
abashev commented on code in PR #12735:
URL: https://github.com/apache/ignite/pull/12735#discussion_r2804970904
##########
modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBeanTest.java:
##########
@@ -0,0 +1,121 @@
+package org.apache.ignite.internal.managers.deployment;
+
+import static java.util.UUID.randomUUID;
+import static org.apache.ignite.lang.IgniteUuid.randomUuid;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.nio.ByteBuffer;
+import java.util.Map;
+import java.util.function.Function;
+import org.apache.ignite.configuration.DeploymentMode;
+import org.apache.ignite.internal.direct.DirectMessageReader;
+import org.apache.ignite.internal.direct.DirectMessageWriter;
+import org.apache.ignite.internal.managers.communication.GridIoMessageFactory;
+import org.apache.ignite.internal.managers.communication.IgniteMessageFactoryImpl;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.plugin.extensions.communication.MessageFactory;
+import org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider;
+import org.apache.ignite.plugin.extensions.communication.MessageSerializer;
+import org.junit.Test;
+
+/**
+ * Tests for {@link GridDeploymentInfoBean} serialization.
+ */
+public class GridDeploymentInfoBeanTest {
Review Comment:
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.
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -18,46 +18,39 @@
package org.apache.ignite.internal.managers.deployment;
import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.nio.ByteBuffer;
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.configuration.DeploymentMode;
-import org.apache.ignite.internal.GridDirectMap;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.plugin.extensions.communication.Message;
-import org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
-import org.apache.ignite.plugin.extensions.communication.MessageReader;
-import org.apache.ignite.plugin.extensions.communication.MessageWriter;
/**
* Deployment info bean.
*/
-public class GridDeploymentInfoBean implements Message, GridDeploymentInfo, Externalizable {
- /** */
- private static final long serialVersionUID = 0L;
-
+public class GridDeploymentInfoBean implements Message, GridDeploymentInfo {
/** */
+ @Order(value = 0, method = "classLoaderId")
private IgniteUuid clsLdrId;
/** */
+ @Order(value = 1, method = "deployMode")
private DeploymentMode depMode;
/** */
+ @Order(value = 4, method = "userVersion")
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27827 Use MessageSerializer for GridDeploymentInfoBean [ignite]
Posted by "abashev (via GitHub)" <gi...@apache.org>.
abashev commented on code in PR #12735:
URL: https://github.com/apache/ignite/pull/12735#discussion_r2804952218
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -82,7 +75,7 @@ public GridDeploymentInfoBean(
this.clsLdrId = clsLdrId;
this.depMode = depMode;
this.userVer = userVer;
- this.participants = participants;
+ this.participants = Map.copyOf(participants);
Review Comment:
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.
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java:
##########
@@ -92,7 +85,7 @@ public GridDeploymentInfoBean(GridDeploymentInfo dep) {
clsLdrId = dep.classLoaderId();
depMode = dep.deployMode();
userVer = dep.userVersion();
- participants = dep.participants();
+ participants = Map.copyOf(dep.participants());
Review Comment:
⬆️
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org