You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "wernerdv (via GitHub)" <gi...@apache.org> on 2025/10/15 13:00:02 UTC
[PR] IGNITE-26612 Use MessageSerializer for MetadataResponseMessage [ignite]
wernerdv opened a new pull request, #12425:
URL: https://github.com/apache/ignite/pull/12425
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-26612 Use MessageSerializer for MetadataResponseMessage [ignite]
Posted by "wernerdv (via GitHub)" <gi...@apache.org>.
wernerdv commented on code in PR #12425:
URL: https://github.com/apache/ignite/pull/12425#discussion_r2445478387
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java:
##########
@@ -17,36 +17,55 @@
package org.apache.ignite.internal.processors.cache.binary;
import java.io.Serializable;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.binary.BinaryMetadata;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.plugin.extensions.communication.Message;
/**
* Wrapper for {@link BinaryMetadata} which is stored in metadata local cache on each node.
* Used internally to track version counters (see javadoc for {@link MetadataUpdateProposedMessage} for more details).
* The version refers solely to the internal protocol for updating BinaryMetadata and is unknown externally.
* It can be updated dynamically from different nodes and threads on the same node.
*/
-final class BinaryMetadataVersionInfo implements Serializable {
+public final class BinaryMetadataVersionInfo implements Serializable, Message {
+ /** Type code. */
+ public static final short TYPE_CODE = 505;
+
/** */
private static final long serialVersionUID = 0L;
/** The actual binary metadata. */
- private final BinaryMetadata metadata;
+ private BinaryMetadata metadata;
+
+ /** Serialized binary metadata. */
+ @Order(0)
+ private byte[] metadataBytes;
/**
* The version of metadata that has been proposed for update. This represents how many unique updates have been issued
* for this type. When a metadata update is proposed, this version is incremented.
*/
- private final int pendingVer;
+ @Order(value = 1, method = "pendingVersion")
+ private int pendingVer;
/**
* The version of metadata that has been accepted by the entire cluster.
* This represents the number of updates that have been confirmed across all nodes.
*/
- private final int acceptedVer;
+ @Order(value = 2, method = "acceptedVersion")
+ private int acceptedVer;
/** A flag indicating whether the metadata is currently being removed. */
private final transient boolean removing;
+ /** Constructor. */
+ public BinaryMetadataVersionInfo() {
+ removing = false;
Review Comment:
Since this variable is declared as final, initialization is required in the constructor.
--
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-26612 Use MessageSerializer for MetadataResponseMessage [ignite]
Posted by "sergey-chugunov-1985 (via GitHub)" <gi...@apache.org>.
sergey-chugunov-1985 commented on code in PR #12425:
URL: https://github.com/apache/ignite/pull/12425#discussion_r2447471336
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataResponseMessage.java:
##########
@@ -16,180 +16,111 @@
*/
package org.apache.ignite.internal.processors.cache.binary;
-import java.nio.ByteBuffer;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.plugin.extensions.communication.Message;
-import org.apache.ignite.plugin.extensions.communication.MessageReader;
-import org.apache.ignite.plugin.extensions.communication.MessageWriter;
/**
* Carries latest version of metadata to client as a response for {@link MetadataRequestMessage}.
*/
public class MetadataResponseMessage implements Message {
- /** */
+ /** Response status if any exception happened during preparing response. */
+ private static final byte ERROR = -1;
Review Comment:
It seems we could get rid of this status. It is never used on a receiver side.
In that case we could get rid of other statuses too and analyze just presence of `metaVerInfo`.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java:
##########
@@ -17,36 +17,55 @@
package org.apache.ignite.internal.processors.cache.binary;
import java.io.Serializable;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.binary.BinaryMetadata;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.plugin.extensions.communication.Message;
/**
* Wrapper for {@link BinaryMetadata} which is stored in metadata local cache on each node.
* Used internally to track version counters (see javadoc for {@link MetadataUpdateProposedMessage} for more details).
* The version refers solely to the internal protocol for updating BinaryMetadata and is unknown externally.
* It can be updated dynamically from different nodes and threads on the same node.
*/
-final class BinaryMetadataVersionInfo implements Serializable {
+public final class BinaryMetadataVersionInfo implements Serializable, Message {
+ /** Type code. */
+ public static final short TYPE_CODE = 505;
+
/** */
private static final long serialVersionUID = 0L;
/** The actual binary metadata. */
- private final BinaryMetadata metadata;
+ private BinaryMetadata metadata;
+
+ /** Serialized binary metadata. */
+ @Order(0)
+ private byte[] metadataBytes;
Review Comment:
I suggest adding `transient` on this new field to possibly reduce amount of data transferred over the network e.g. on node join.
--
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-26612 Use MessageSerializer for MetadataResponseMessage [ignite]
Posted by "sergey-chugunov-1985 (via GitHub)" <gi...@apache.org>.
sergey-chugunov-1985 merged PR #12425:
URL: https://github.com/apache/ignite/pull/12425
--
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-26612 Use MessageSerializer for MetadataResponseMessage [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja commented on code in PR #12425:
URL: https://github.com/apache/ignite/pull/12425#discussion_r2445400609
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java:
##########
@@ -17,36 +17,55 @@
package org.apache.ignite.internal.processors.cache.binary;
import java.io.Serializable;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.binary.BinaryMetadata;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.plugin.extensions.communication.Message;
/**
* Wrapper for {@link BinaryMetadata} which is stored in metadata local cache on each node.
* Used internally to track version counters (see javadoc for {@link MetadataUpdateProposedMessage} for more details).
* The version refers solely to the internal protocol for updating BinaryMetadata and is unknown externally.
* It can be updated dynamically from different nodes and threads on the same node.
*/
-final class BinaryMetadataVersionInfo implements Serializable {
+public final class BinaryMetadataVersionInfo implements Serializable, Message {
+ /** Type code. */
+ public static final short TYPE_CODE = 505;
+
/** */
private static final long serialVersionUID = 0L;
/** The actual binary metadata. */
- private final BinaryMetadata metadata;
+ private BinaryMetadata metadata;
+
+ /** Serialized binary metadata. */
+ @Order(0)
+ private byte[] metadataBytes;
/**
* The version of metadata that has been proposed for update. This represents how many unique updates have been issued
* for this type. When a metadata update is proposed, this version is incremented.
*/
- private final int pendingVer;
+ @Order(value = 1, method = "pendingVersion")
+ private int pendingVer;
/**
* The version of metadata that has been accepted by the entire cluster.
* This represents the number of updates that have been confirmed across all nodes.
*/
- private final int acceptedVer;
+ @Order(value = 2, method = "acceptedVersion")
+ private int acceptedVer;
/** A flag indicating whether the metadata is currently being removed. */
private final transient boolean removing;
+ /** Constructor. */
+ public BinaryMetadataVersionInfo() {
+ removing = false;
Review Comment:
Let's remove, false by default.
--
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-26612 Use MessageSerializer for MetadataResponseMessage [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12425:
URL: https://github.com/apache/ignite/pull/12425#issuecomment-3435651689
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12425) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12425&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12425&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12425&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12425&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12425&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12425)
--
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