ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: # ignite-709_3
Date Fri, 15 May 2015 13:38:47 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-709_3 ef6dd4119 -> 33459b196


# ignite-709_3


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

Branch: refs/heads/ignite-709_3
Commit: 33459b1960c5d551a90fa2b57e1b1ab9e38293f9
Parents: ef6dd41
Author: sboikov <sboikov@gridgain.com>
Authored: Fri May 15 17:36:21 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri May 15 17:36:21 2015 +0300

----------------------------------------------------------------------
 .../discovery/GridDiscoveryManager.java         |  4 +-
 .../processors/cache/GridCacheProcessor.java    |  2 +-
 .../IgniteDynamicClientCacheStartSelfTest.java  | 70 ++++++++++++++++++++
 .../igfs/IgfsClientCacheSelfTest.java           |  3 +-
 4 files changed, 75 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/33459b19/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index eac96b2..f81d471 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -2538,8 +2538,8 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
             if (node.isDaemon())
                 return false;
 
-            if (nearEnabled && CU.affinityNode(node, cacheFilter))
-                return true;
+            if (CU.affinityNode(node, cacheFilter))
+                return nearEnabled;
 
             Boolean near = clientNodes.get(node.id());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/33459b19/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 9469e65..6295d28 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -622,7 +622,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 ctx.discovery().setCacheFilter(
                     cfg.getName(),
                     cfg.getNodeFilter(),
-                    cfg.getNearConfiguration() != null,
+                    cfg.getNearConfiguration() != null && cfg.getCacheMode() == PARTITIONED,
                     cfg.getCacheMode() == LOCAL);
 
                 ctx.discovery().addClientNode(cfg.getName(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/33459b19/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicClientCacheStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicClientCacheStartSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicClientCacheStartSelfTest.java
index 9745ad8..24935c7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicClientCacheStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicClientCacheStartSelfTest.java
@@ -32,6 +32,8 @@ import org.apache.ignite.testframework.junits.common.*;
 
 import java.util.concurrent.*;
 
+import static org.apache.ignite.cache.CacheMode.*;
+
 /**
  * Tests that cache specified in configuration start on client nodes.
  */
@@ -153,6 +155,74 @@ public class IgniteDynamicClientCacheStartSelfTest extends GridCommonAbstractTes
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testReplicatedCacheClient() throws Exception {
+        ccfg = new CacheConfiguration();
+
+        ccfg.setCacheMode(REPLICATED);
+
+        final String cacheName = null;
+
+        Ignite ignite0 = startGrid(0);
+
+        checkCache(ignite0, cacheName, true, false);
+
+        client = true;
+
+        final Ignite ignite1 = startGrid(1);
+
+        checkCache(ignite1, cacheName, false, false);
+
+        ccfg.setNearConfiguration(new NearCacheConfiguration());
+
+        Ignite ignite2 = startGrid(2);
+
+        checkCache(ignite2, cacheName, false, true);
+
+        ccfg = null;
+
+        Ignite ignite3 = startGrid(3);
+
+        checkNoCache(ignite3, cacheName);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testReplicatedWithNearCacheClient() throws Exception {
+        ccfg = new CacheConfiguration();
+
+        ccfg.setNearConfiguration(new NearCacheConfiguration());
+
+        ccfg.setCacheMode(REPLICATED);
+
+        final String cacheName = null;
+
+        Ignite ignite0 = startGrid(0);
+
+        checkCache(ignite0, cacheName, true, false);
+
+        client = true;
+
+        final Ignite ignite1 = startGrid(1);
+
+        checkCache(ignite1, cacheName, false, true);
+
+        ccfg.setNearConfiguration(null);
+
+        Ignite ignite2 = startGrid(2);
+
+        checkCache(ignite2, cacheName, false, false);
+
+        ccfg = null;
+
+        Ignite ignite3 = startGrid(3);
+
+        checkNoCache(ignite3, cacheName);
+    }
+
+    /**
      * @param ignite Node.
      * @param cacheName Cache name
      * @param srv {@code True} if server cache is expected.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/33459b19/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java
index d983302..02166c4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsClientCacheSelfTest.java
@@ -114,11 +114,12 @@ public class IgfsClientCacheSelfTest extends IgfsAbstractSelfTest {
 
         cacheCfg.setName(cacheName);
 
+        cacheCfg.setNearConfiguration(null);
+
         if (META_CACHE_NAME.equals(cacheName))
             cacheCfg.setCacheMode(REPLICATED);
         else {
             cacheCfg.setCacheMode(PARTITIONED);
-            cacheCfg.setNearConfiguration(null);
 
             cacheCfg.setBackups(0);
             cacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(128));


Mime
View raw message