You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "NSAmelchev (via GitHub)" <gi...@apache.org> on 2025/12/23 21:34:12 UTC
[PR] IGNITE-27415 Use MessageSerializer for TcpDiscoveryAuthFailedMessage [ignite]
NSAmelchev opened a new pull request, #12605:
URL: https://github.com/apache/ignite/pull/12605
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-27415 Use MessageSerializer for TcpDiscoveryAuthFailedMessage [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #12605:
URL: https://github.com/apache/ignite/pull/12605#discussion_r2645860167
##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/InetSocketAddressMessage.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spi.discovery.tcp.messages;
+
+import java.net.InetAddress;
+import org.apache.ignite.internal.Order;
+import org.apache.ignite.internal.managers.discovery.DiscoveryMessageFactory;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/** Address utility container message. Is not a pure {@link TcpDiscoveryAbstractMessage}. */
Review Comment:
`Socket address utility container message.`
--
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-27415 Use MessageSerializer for TcpDiscoveryAuthFailedMessage [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #12605:
URL: https://github.com/apache/ignite/pull/12605#discussion_r2645861650
##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/InetSocketAddressMessage.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spi.discovery.tcp.messages;
+
+import java.net.InetAddress;
+import org.apache.ignite.internal.Order;
+import org.apache.ignite.internal.managers.discovery.DiscoveryMessageFactory;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/** Address utility container message. Is not a pure {@link TcpDiscoveryAbstractMessage}. */
+public class InetSocketAddressMessage extends InetAddressMessage {
+ /** */
+ @Order(2)
+ private int port;
+
+ /**
+ * Default constructor for {@link DiscoveryMessageFactory}.
+ */
+ public InetSocketAddressMessage() {
+ // No-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param addr Address.
+ * @param port Port.
+ */
+ public InetSocketAddressMessage(InetAddress addr, int port) {
+ super(addr);
+
+ this.port = port;
+ }
+
+ /** @return port. */
+ public int port() {
+ return port;
+ }
+
+ /** @param port port. */
Review Comment:
`port port.` -> `port Port.`
--
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-27415 Use MessageSerializer for TcpDiscoveryAuthFailedMessage [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #12605:
URL: https://github.com/apache/ignite/pull/12605#discussion_r2645863830
##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAuthFailedMessage.java:
##########
@@ -17,27 +17,33 @@
package org.apache.ignite.spi.discovery.tcp.messages;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import java.net.InetAddress;
import java.util.UUID;
+import org.apache.ignite.internal.Order;
+import org.apache.ignite.internal.managers.discovery.DiscoveryMessageFactory;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.plugin.extensions.communication.Message;
/**
* Message telling joining node that its authentication failed on coordinator.
*/
-public class TcpDiscoveryAuthFailedMessage extends TcpDiscoveryAbstractMessage {
+public class TcpDiscoveryAuthFailedMessage extends TcpDiscoveryAbstractMessage implements Message {
/** */
private static final long serialVersionUID = 0L;
/** Coordinator address. */
- private transient InetAddress addr;
+ @Order(value = 5, method = "addressMessage")
+ private InetAddressMessage addr;
Review Comment:
`addr` -> `addrMsg`
--
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-27415 Use MessageSerializer for TcpDiscoveryAuthFailedMessage [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #12605:
URL: https://github.com/apache/ignite/pull/12605#discussion_r2645885202
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryMessageFactory.java:
##########
@@ -48,7 +52,8 @@
public class DiscoveryMessageFactory implements MessageFactoryProvider {
/** {@inheritDoc} */
@Override public void registerAll(MessageFactory factory) {
- factory.register((short)-100, InetAddressMessage::new, new InetAddressMessageSerializer());
+ factory.register((short)-101, InetAddressMessage::new, new InetAddressMessageSerializer());
Review Comment:
`InetSocketAddressMessage` extends `InetAddressMessage`. Its number should be higher. We use negative numbering here, so -101 id bigger that -100 as order. I sugget setting direct type -100 for `InetAddressMessage` and -101 for `InetSocketAddressMessage`
--
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-27415 Use MessageSerializer for TcpDiscoveryAuthFailedMessage [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12605:
URL: https://github.com/apache/ignite/pull/12605#issuecomment-3690261231
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12605) **Quality Gate failed**
Failed conditions
 [3 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12605) (required ≤ 1)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12605)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
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-27415 Use MessageSerializer for TcpDiscoveryAuthFailedMessage [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #12605:
URL: https://github.com/apache/ignite/pull/12605#discussion_r2645863830
##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAuthFailedMessage.java:
##########
@@ -17,27 +17,33 @@
package org.apache.ignite.spi.discovery.tcp.messages;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import java.net.InetAddress;
import java.util.UUID;
+import org.apache.ignite.internal.Order;
+import org.apache.ignite.internal.managers.discovery.DiscoveryMessageFactory;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.plugin.extensions.communication.Message;
/**
* Message telling joining node that its authentication failed on coordinator.
*/
-public class TcpDiscoveryAuthFailedMessage extends TcpDiscoveryAbstractMessage {
+public class TcpDiscoveryAuthFailedMessage extends TcpDiscoveryAbstractMessage implements Message {
/** */
private static final long serialVersionUID = 0L;
/** Coordinator address. */
- private transient InetAddress addr;
+ @Order(value = 5, method = "addressMessage")
+ private InetAddressMessage addr;
Review Comment:
`addr` -> `addrMsg`. Or even `coordinatorAddrMsg` with the methods renamings.
--
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-27415 Use MessageSerializer for TcpDiscoveryAuthFailedMessage [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12605:
URL: https://github.com/apache/ignite/pull/12605#issuecomment-3690278245
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12605) **Quality Gate failed**
Failed conditions
 [3 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12605) (required ≤ 1)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12605)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
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-27415 Use MessageSerializer for TcpDiscoveryAuthFailedMessage [ignite]
Posted by "Vladsz83 (via GitHub)" <gi...@apache.org>.
Vladsz83 commented on code in PR #12605:
URL: https://github.com/apache/ignite/pull/12605#discussion_r2645867694
##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAuthFailedMessage.java:
##########
@@ -48,40 +54,38 @@ public class TcpDiscoveryAuthFailedMessage extends TcpDiscoveryAbstractMessage {
public TcpDiscoveryAuthFailedMessage(UUID creatorNodeId, InetAddress addr, UUID targetNodeId) {
super(creatorNodeId);
- this.addr = addr;
+ this.addr = new InetAddressMessage(addr);
this.targetNodeId = targetNodeId;
}
- /**
- * @return Node for which authentication was failed.
- */
- public UUID getTargetNodeId() {
+ /** @return Node for which authentication was failed. */
+ public UUID targetNodeId() {
return targetNodeId;
}
- /**
- * @return Coordinator address.
- */
- public InetAddress address() {
- return addr;
+ /** @param targetNodeId Node for which authentication was failed. */
+ public void targetNodeId(UUID targetNodeId) {
+ this.targetNodeId = targetNodeId;
}
- /**
- * Serialize this message.
- */
- private void writeObject(ObjectOutputStream out) throws IOException {
- out.defaultWriteObject();
+ /** @return Coordinator address. */
Review Comment:
`Coordinator address message`
##########
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAuthFailedMessage.java:
##########
@@ -48,40 +54,38 @@ public class TcpDiscoveryAuthFailedMessage extends TcpDiscoveryAbstractMessage {
public TcpDiscoveryAuthFailedMessage(UUID creatorNodeId, InetAddress addr, UUID targetNodeId) {
super(creatorNodeId);
- this.addr = addr;
+ this.addr = new InetAddressMessage(addr);
this.targetNodeId = targetNodeId;
}
- /**
- * @return Node for which authentication was failed.
- */
- public UUID getTargetNodeId() {
+ /** @return Node for which authentication was failed. */
+ public UUID targetNodeId() {
return targetNodeId;
}
- /**
- * @return Coordinator address.
- */
- public InetAddress address() {
- return addr;
+ /** @param targetNodeId Node for which authentication was failed. */
+ public void targetNodeId(UUID targetNodeId) {
+ this.targetNodeId = targetNodeId;
}
- /**
- * Serialize this message.
- */
- private void writeObject(ObjectOutputStream out) throws IOException {
- out.defaultWriteObject();
+ /** @return Coordinator address. */
+ public InetAddressMessage addressMessage() {
+ return addr;
+ }
- U.writeByteArray(out, addr.getAddress());
+ /** @param addr Coordinator address. */
Review Comment:
`Coordinator address message.`
--
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-27415 Use MessageSerializer for TcpDiscoveryAuthFailedMessage [ignite]
Posted by "NSAmelchev (via GitHub)" <gi...@apache.org>.
NSAmelchev merged PR #12605:
URL: https://github.com/apache/ignite/pull/12605
--
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