You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by av...@apache.org on 2016/02/02 11:13:14 UTC

ignite git commit: 1523 Fixed Client node deserialization

Repository: ignite
Updated Branches:
  refs/heads/ignite-1523 67f262f9e -> 78ffed033


1523 Fixed Client node deserialization


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/78ffed03
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/78ffed03
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/78ffed03

Branch: refs/heads/ignite-1523
Commit: 78ffed03342e51f08f523b4c965cbec2a91be386
Parents: 67f262f
Author: Anton Vinogradov <av...@apache.org>
Authored: Tue Feb 2 13:12:12 2016 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Tue Feb 2 13:12:12 2016 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/ClientImpl.java    |  6 +++--
 .../GridCacheReplicatedPreloadSelfTest.java     | 23 ++++++++++++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/78ffed03/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 850cc24..b12f7a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -1665,7 +1665,8 @@ class ClientImpl extends TcpDiscoveryImpl {
 
                     if (dataMap != null) {
                         for (Map.Entry<UUID, Map<Integer, byte[]>> entry : dataMap.entrySet())
-                            spi.onExchange(getLocalNodeId(), entry.getKey(), entry.getValue(), null);
+                            spi.onExchange(getLocalNodeId(), entry.getKey(), entry.getValue(),
+                                U.resolveClassLoader(spi.ignite().configuration().getClassLoader()));
                     }
 
                     locNode.setAttributes(msg.clientNodeAttributes());
@@ -1961,7 +1962,8 @@ class ClientImpl extends TcpDiscoveryImpl {
 
                     if (node != null && node.visible()) {
                         try {
-                            DiscoverySpiCustomMessage msgObj = msg.message(spi.marsh);
+                            DiscoverySpiCustomMessage msgObj = msg.message(spi.marsh,
+                                spi.ignite().configuration().getClassLoader());
 
                             notifyDiscovery(EVT_DISCOVERY_CUSTOM_EVT, topVer, node, allVisibleNodes(), msgObj);
                         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/78ffed03/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java
index adfcbaf..523f641 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java
@@ -74,6 +74,9 @@ public class GridCacheReplicatedPreloadSelfTest extends GridCommonAbstractTest {
     private volatile boolean needStore = false;
 
     /** */
+    private volatile boolean isClient = false;
+
+    /** */
     private TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
 
     /** {@inheritDoc} */
@@ -108,6 +111,9 @@ public class GridCacheReplicatedPreloadSelfTest extends GridCommonAbstractTest {
         if (getTestGridName(1).equals(gridName) || cfg.getMarshaller() instanceof BinaryMarshaller)
             cfg.setClassLoader(getExternalClassLoader());
 
+        if (isClient)
+            cfg.setClientMode(true);
+
         return cfg;
     }
 
@@ -306,12 +312,20 @@ public class GridCacheReplicatedPreloadSelfTest extends GridCommonAbstractTest {
 
                 Ignite g2 = startGrid(2);  // Checks deserialization at node join.
 
+                isClient = true;
+
+                Ignite g3 = startGrid(3);
+
+                isClient = false;
+
                 IgniteCache<Integer, Object> cache1 = g1.cache(null);
                 IgniteCache<Integer, Object> cache2 = g2.cache(null);
+                IgniteCache<Integer, Object> cache3 = g3.cache(null);
 
                 cache1.put(1, 1);
 
                 assertEquals(1, cache2.get(1));
+                assertEquals(1, cache3.get(1));
 
                 needStore = false;
 
@@ -320,6 +334,12 @@ public class GridCacheReplicatedPreloadSelfTest extends GridCommonAbstractTest {
                 g1 = startGrid(1);
                 g2 = startGrid(2);
 
+                isClient = true;
+
+                g3 = startGrid(3);
+
+                isClient = false;
+
                 Object sf = ldr.loadClass("org.apache.ignite.tests.p2p.CacheDeploymentTestStoreFactory").newInstance();
 
                 cfg.setCacheStoreFactory((Factory)sf);
@@ -328,14 +348,17 @@ public class GridCacheReplicatedPreloadSelfTest extends GridCommonAbstractTest {
                 cache1 = g1.createCache(cfg);
 
                 cache2 = g2.getOrCreateCache(cfg); // Checks deserialization at cache creation.
+                cache3 = g3.getOrCreateCache(cfg); // Checks deserialization at cache creation.
 
                 cache1.put(1, 1);
 
                 assertEquals(1, cache2.get(1));
+                assertEquals(1, cache3.get(1));
             }
         }
         finally {
             needStore = false;
+            isClient = false;
 
             stopAllGrids();
         }