You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2023/01/18 10:58:59 UTC

[GitHub] [ignite-3] sashapolo opened a new pull request, #1544: IGNITE-18570 Use network serialization for Meta Storage API

sashapolo opened a new pull request, #1544:
URL: https://github.com/apache/ignite-3/pull/1544

   https://issues.apache.org/jira/browse/IGNITE-18570


-- 
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


[GitHub] [ignite-3] sashapolo commented on a diff in pull request #1544: IGNITE-18570 Use network serialization for Meta Storage API

Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo commented on code in PR #1544:
URL: https://github.com/apache/ignite-3/pull/1544#discussion_r1088812944


##########
modules/metastorage-api/src/main/java/org/apache/ignite/internal/metastorage/dsl/MetaStorageMessageGroup.java:
##########
@@ -0,0 +1,60 @@
+/*
+ * 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.internal.metastorage.dsl;
+
+import org.apache.ignite.internal.metastorage.dsl.SimpleCondition.RevisionCondition;
+import org.apache.ignite.internal.metastorage.dsl.SimpleCondition.ValueCondition;
+import org.apache.ignite.internal.metastorage.dsl.Statement.IfStatement;
+import org.apache.ignite.internal.metastorage.dsl.Statement.UpdateStatement;
+import org.apache.ignite.network.annotations.MessageGroup;
+
+/**
+ * Message group for Meta Storage messages.
+ */
+@MessageGroup(groupType = 222, groupName = "MetaStorageMessages")

Review Comment:
   No particular reason



-- 
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


[GitHub] [ignite-3] sashapolo commented on a diff in pull request #1544: IGNITE-18570 Use network serialization for Meta Storage API

Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo commented on code in PR #1544:
URL: https://github.com/apache/ignite-3/pull/1544#discussion_r1088813138


##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/command/MetastorageCommandsMessageGroup.java:
##########
@@ -21,41 +21,13 @@
 import org.apache.ignite.internal.metastorage.command.cursor.CursorHasNextCommand;
 import org.apache.ignite.internal.metastorage.command.cursor.CursorNextCommand;
 import org.apache.ignite.internal.metastorage.command.cursor.CursorsCloseCommand;
-import org.apache.ignite.internal.metastorage.command.info.CompoundConditionInfo;
-import org.apache.ignite.internal.metastorage.command.info.IfInfo;
-import org.apache.ignite.internal.metastorage.command.info.OperationInfo;
-import org.apache.ignite.internal.metastorage.command.info.SimpleConditionInfo;
-import org.apache.ignite.internal.metastorage.command.info.StatementInfo;
-import org.apache.ignite.internal.metastorage.command.info.StatementResultInfo;
-import org.apache.ignite.internal.metastorage.command.info.UpdateInfo;
 import org.apache.ignite.network.annotations.MessageGroup;
 
 /**
  * Message group for meta-storage RAFT commands and other required classes.
  */
 @MessageGroup(groupType = 111, groupName = "MetaStorageCommands")
 public interface MetastorageCommandsMessageGroup {
-    /** Message type for {@link OperationInfo}. */
-    short OPERATION_INFO = 1;
-
-    /** Message type for {@link UpdateInfo}. */
-    short UPDATE_INFO = 2;
-
-    /** Message type for {@link StatementInfo}. */
-    short STATEMENT_INFO = 3;
-
-    /** Message type for {@link SimpleConditionInfo}. */
-    short SIMPLE_CONDITION_INFO = 4;
-
-    /** Message type for {@link CompoundConditionInfo}. */
-    short COMPOUND_CONDITION_INFO = 5;
-
-    /** Message type for {@link StatementResultInfo}. */
-    short STATEMENT_RESULT_INFO = 6;
-
-    /** Message type for {@link IfInfo}. */
-    short IF_INFO = 7;
-
     /** Message type for {@link InvokeCommand}. */
     short INVOKE = 10;

Review Comment:
   To reduce the amount 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


[GitHub] [ignite-3] sashapolo commented on a diff in pull request #1544: IGNITE-18570 Use network serialization for Meta Storage API

Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo commented on code in PR #1544:
URL: https://github.com/apache/ignite-3/pull/1544#discussion_r1088812731


##########
modules/network/src/main/java/org/apache/ignite/internal/network/netty/OutboundEncoder.java:
##########
@@ -96,14 +96,12 @@ private NetworkMessageChunkedInput(
             this.serializationService = serializationService;
             this.msg = outObject.networkMessage();
 
-            if (!outObject.descriptors().isEmpty()) {
-                List<ClassDescriptorMessage> descriptors = outObject.descriptors();
+            List<ClassDescriptorMessage> outDescriptors = outObject.descriptors().stream()
+                    .filter(classDescriptorMessage -> !serializationService.isDescriptorSent(classDescriptorMessage.descriptorId()))
+                    .collect(Collectors.toList());
 
-                descriptors = descriptors.stream()
-                        .filter(classDescriptorMessage -> !serializationService.isDescriptorSent(classDescriptorMessage.descriptorId()))
-                        .collect(Collectors.toList());
-
-                this.descriptors = MSG_FACTORY.classDescriptorListMessage().messages(descriptors).build();
+            if (!outDescriptors.isEmpty()) {

Review Comment:
   Noticed this behavior during a debugging session



-- 
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


[GitHub] [ignite-3] SammyVimes commented on a diff in pull request #1544: IGNITE-18570 Use network serialization for Meta Storage API

Posted by "SammyVimes (via GitHub)" <gi...@apache.org>.
SammyVimes commented on code in PR #1544:
URL: https://github.com/apache/ignite-3/pull/1544#discussion_r1088808392


##########
modules/metastorage-api/src/main/java/org/apache/ignite/internal/metastorage/dsl/MetaStorageMessageGroup.java:
##########
@@ -0,0 +1,60 @@
+/*
+ * 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.internal.metastorage.dsl;
+
+import org.apache.ignite.internal.metastorage.dsl.SimpleCondition.RevisionCondition;
+import org.apache.ignite.internal.metastorage.dsl.SimpleCondition.ValueCondition;
+import org.apache.ignite.internal.metastorage.dsl.Statement.IfStatement;
+import org.apache.ignite.internal.metastorage.dsl.Statement.UpdateStatement;
+import org.apache.ignite.network.annotations.MessageGroup;
+
+/**
+ * Message group for Meta Storage messages.
+ */
+@MessageGroup(groupType = 222, groupName = "MetaStorageMessages")

Review Comment:
   Why 222?



##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/command/MetastorageCommandsMessageGroup.java:
##########
@@ -21,41 +21,13 @@
 import org.apache.ignite.internal.metastorage.command.cursor.CursorHasNextCommand;
 import org.apache.ignite.internal.metastorage.command.cursor.CursorNextCommand;
 import org.apache.ignite.internal.metastorage.command.cursor.CursorsCloseCommand;
-import org.apache.ignite.internal.metastorage.command.info.CompoundConditionInfo;
-import org.apache.ignite.internal.metastorage.command.info.IfInfo;
-import org.apache.ignite.internal.metastorage.command.info.OperationInfo;
-import org.apache.ignite.internal.metastorage.command.info.SimpleConditionInfo;
-import org.apache.ignite.internal.metastorage.command.info.StatementInfo;
-import org.apache.ignite.internal.metastorage.command.info.StatementResultInfo;
-import org.apache.ignite.internal.metastorage.command.info.UpdateInfo;
 import org.apache.ignite.network.annotations.MessageGroup;
 
 /**
  * Message group for meta-storage RAFT commands and other required classes.
  */
 @MessageGroup(groupType = 111, groupName = "MetaStorageCommands")
 public interface MetastorageCommandsMessageGroup {
-    /** Message type for {@link OperationInfo}. */
-    short OPERATION_INFO = 1;
-
-    /** Message type for {@link UpdateInfo}. */
-    short UPDATE_INFO = 2;
-
-    /** Message type for {@link StatementInfo}. */
-    short STATEMENT_INFO = 3;
-
-    /** Message type for {@link SimpleConditionInfo}. */
-    short SIMPLE_CONDITION_INFO = 4;
-
-    /** Message type for {@link CompoundConditionInfo}. */
-    short COMPOUND_CONDITION_INFO = 5;
-
-    /** Message type for {@link StatementResultInfo}. */
-    short STATEMENT_RESULT_INFO = 6;
-
-    /** Message type for {@link IfInfo}. */
-    short IF_INFO = 7;
-
     /** Message type for {@link InvokeCommand}. */
     short INVOKE = 10;

Review Comment:
   Why not 0?



##########
modules/network/src/main/java/org/apache/ignite/internal/network/netty/OutboundEncoder.java:
##########
@@ -96,14 +96,12 @@ private NetworkMessageChunkedInput(
             this.serializationService = serializationService;
             this.msg = outObject.networkMessage();
 
-            if (!outObject.descriptors().isEmpty()) {
-                List<ClassDescriptorMessage> descriptors = outObject.descriptors();
+            List<ClassDescriptorMessage> outDescriptors = outObject.descriptors().stream()
+                    .filter(classDescriptorMessage -> !serializationService.isDescriptorSent(classDescriptorMessage.descriptorId()))
+                    .collect(Collectors.toList());
 
-                descriptors = descriptors.stream()
-                        .filter(classDescriptorMessage -> !serializationService.isDescriptorSent(classDescriptorMessage.descriptorId()))
-                        .collect(Collectors.toList());
-
-                this.descriptors = MSG_FACTORY.classDescriptorListMessage().messages(descriptors).build();
+            if (!outDescriptors.isEmpty()) {

Review Comment:
   Nice Catch!



-- 
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


[GitHub] [ignite-3] SammyVimes merged pull request #1544: IGNITE-18570 Use network serialization for Meta Storage API

Posted by "SammyVimes (via GitHub)" <gi...@apache.org>.
SammyVimes merged PR #1544:
URL: https://github.com/apache/ignite-3/pull/1544


-- 
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