ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntikho...@apache.org
Subject [12/20] ignite git commit: ignite-2521: Configuration variations tests framework + IgniteCacheBasicConfigVariationsFullApiTestSuite + ignite-2554: Fixed Affinity.mapKeyToNode() for dynamically started LOCAL cache
Date Tue, 01 Mar 2016 11:09:38 GMT
ignite-2521: Configuration variations tests framework + IgniteCacheBasicConfigVariationsFullApiTestSuite
+ ignite-2554: Fixed Affinity.mapKeyToNode() for dynamically started LOCAL cache


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

Branch: refs/heads/ignite-1186
Commit: 953b575f0321acd90374c2dd92b32825842999ab
Parents: 49dcd6b
Author: ashutak <ashutak@gridgain.com>
Authored: Mon Feb 29 14:00:45 2016 +0300
Committer: ashutak <ashutak@gridgain.com>
Committed: Mon Feb 29 14:00:45 2016 +0300

----------------------------------------------------------------------
 .../cache/affinity/GridCacheAffinityImpl.java   |    7 +-
 .../cache/GridCacheAbstractFullApiSelfTest.java |   10 +-
 .../IgniteCacheConfigVariationsFullApiTest.java | 5851 ++++++++++++++++++
 .../configvariations/CacheStartMode.java        |   29 +
 .../configvariations/ConfigFactory.java         |   39 +
 .../configvariations/ConfigParameter.java       |   34 +
 .../configvariations/ConfigVariations.java      |  346 ++
 .../ConfigVariationsFactory.java                |  197 +
 .../ConfigVariationsTestSuiteBuilder.java       |  382 ++
 .../IgniteConfigVariationsTestSuite.java        |   50 +
 .../configvariations/Parameters.java            |  377 ++
 .../configvariations/VariationsIterator.java    |  174 +
 .../configvariations/VariationsTestsConfig.java |  161 +
 .../testframework/junits/GridAbstractTest.java  |   43 +-
 ...IgniteCacheConfigVariationsAbstractTest.java |  583 ++
 .../IgniteConfigVariationsAbstractTest.java     |  420 ++
 .../ConfigVariationsTestSuiteBuilderTest.java   |  112 +
 .../testframework/test/ParametersTest.java      |   87 +
 .../test/VariationsIteratorTest.java            |  156 +
 .../ignite/testsuites/IgniteBasicTestSuite.java |    8 +
 ...heBasicConfigVariationsFullApiTestSuite.java |   41 +
 21 files changed, 9094 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/953b575f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
index 3bc71fe..6567141 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
@@ -193,7 +193,12 @@ public class GridCacheAffinityImpl<K, V> implements Affinity<K>
{
 
         AffinityTopologyVersion topVer = topologyVersion();
 
-        int nodesCnt = cctx.discovery().cacheAffinityNodes(cctx.name(), topVer).size();
+        int nodesCnt;
+
+        if (!cctx.isLocal())
+            nodesCnt = cctx.discovery().cacheAffinityNodes(cctx.name(), topVer).size();
+        else
+            nodesCnt = 1;
 
         // Must return empty map if no alive nodes present or keys is empty.
         Map<ClusterNode, Collection<K>> res = new HashMap<>(nodesCnt, 1.0f);

http://git-wip-us.apache.org/repos/asf/ignite/blob/953b575f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 222a96b..401afbf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -65,7 +65,6 @@ import org.apache.ignite.events.Event;
 import org.apache.ignite.internal.IgniteEx;
 import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.IgnitionEx;
-import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager;
 import org.apache.ignite.internal.processors.resource.GridSpringResourceContext;
 import org.apache.ignite.internal.util.lang.GridAbsPredicate;
@@ -231,8 +230,10 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
                     Ignite ignite = grid(entry.getKey());
 
                     for (CacheConfiguration cfg : entry.getValue())
-                        ignite.createCache(cfg);
+                        ignite.getOrCreateCache(cfg);
                 }
+
+                awaitPartitionMapExchange();
             }
             else {
                 int cnt = gridCount();
@@ -5565,12 +5566,13 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
      *
      */
     private static class CheckCacheSizeTask extends TestIgniteIdxRunnable {
+        /** */
         private final Map<String, Integer> map;
 
         /**
          * @param map Map.
          */
-        public CheckCacheSizeTask(Map<String, Integer> map) {
+        CheckCacheSizeTask(Map<String, Integer> map) {
             this.map = map;
         }
 
@@ -5581,7 +5583,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
             int size = 0;
 
             for (String key : map.keySet())
-                if (ctx.affinity().localNode(key, new AffinityTopologyVersion(ctx.discovery().topologyVersion())))
+                if (ctx.affinity().localNode(key, ctx.discovery().topologyVersionEx()))
                     size++;
 
             assertEquals("Incorrect key size on cache #" + idx, size, ignite.cache(ctx.name()).localSize(ALL));


Mime
View raw message