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 2022/01/13 15:16:03 UTC

[GitHub] [ignite-3] SammyVimes commented on a change in pull request #539: IGNITE-16250 Network serialization improvement

SammyVimes commented on a change in pull request #539:
URL: https://github.com/apache/ignite-3/pull/539#discussion_r784054724



##########
File path: modules/network/src/integrationTest/java/org/apache/ignite/utils/ClusterServiceTestUtils.java
##########
@@ -39,12 +52,49 @@
 import org.apache.ignite.network.StaticNodeFinder;
 import org.apache.ignite.network.TopologyService;
 import org.apache.ignite.network.scalecube.TestScaleCubeClusterServiceFactory;
+import org.apache.ignite.network.serialization.MessageSerializationRegistry;
+import org.apache.ignite.network.serialization.MessageSerializationRegistryInitializer;
 import org.junit.jupiter.api.TestInfo;
 
 /**
  * Test utils that provide sort of cluster service mock that manages required node configuration internally.
  */
 public class ClusterServiceTestUtils {
+    /** Registry initializers collected via reflection. */
+    static List<Consumer<MessageSerializationRegistry>> REGISTRY_INITIALIZERS = new ArrayList<>();
+
+    static {
+        // Automatically find all registry initializers to avoid configuring serialization registry manually in every test.
+        Lookup lookup = MethodHandles.lookup();
+
+        String className = MessageSerializationRegistryInitializer.class.getName();
+
+        // ClassGraph library should be in classpath along with ignite-network test-jar
+        try (ScanResult scanResult = new ClassGraph().whitelistPackages("org.apache.ignite").enableClassInfo().scan()) {
+            for (ClassInfo ci : scanResult.getClassesImplementing(className)) {
+                Class<?> clazz = ci.loadClass();
+
+                if (clazz == NetworkMessagesSerializationRegistryInitializer.class) {
+                    continue;

Review comment:
       This class is registered automatically in the MessageSerializationRegistryImpl (added a 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