ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [13/50] [abbrv] incubator-ignite git commit: IGNITE-45 - Fixing tests.
Date Fri, 20 Mar 2015 15:48:08 GMT
IGNITE-45 - Fixing tests.


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

Branch: refs/heads/ignite-525
Commit: bbcda443299d4110868f8174b755b8c41afc2af6
Parents: 77d7eb8
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Thu Mar 19 14:00:03 2015 -0700
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Thu Mar 19 14:00:03 2015 -0700

----------------------------------------------------------------------
 .../processors/cache/GridCacheProcessor.java        |  8 ++++----
 ...hePartitionedAffinityHashIdResolverSelfTest.java | 16 +++++++++++-----
 2 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bbcda443/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 2ecb96a..7c0a581 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
@@ -1778,8 +1778,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      * @return Validation result or {@code null} in case of success.
      */
     @Nullable private IgniteSpiNodeValidationResult validateHashIdResolvers(ClusterNode node)
{
-        for (GridCacheAdapter cache : ctx.cache().internalCaches()) {
-            CacheConfiguration cfg = cache.configuration();
+        for (DynamicCacheDescriptor desc : registeredCaches.values()) {
+            CacheConfiguration cfg = desc.cacheConfiguration();
 
             if (cfg.getAffinity() instanceof CacheRendezvousAffinityFunction) {
                 CacheRendezvousAffinityFunction aff = (CacheRendezvousAffinityFunction)cfg.getAffinity();
@@ -1795,12 +1795,12 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
                     if (nodeHashObj.hashCode() == topNodeHashObj.hashCode()) {
                         String errMsg = "Failed to add node to topology because it has the
same hash code for " +
-                            "partitioned affinity as one of existing nodes [cacheName=" +
cache.name() +
+                            "partitioned affinity as one of existing nodes [cacheName=" +
cfg.getName() +
                             ", hashIdResolverClass=" + hashIdRslvr.getClass().getName() +
                             ", existingNodeId=" + topNode.id() + ']';
 
                         String sndMsg = "Failed to add node to topology because it has the
same hash code for " +
-                            "partitioned affinity as one of existing nodes [cacheName=" +
cache.name() +
+                            "partitioned affinity as one of existing nodes [cacheName=" +
cfg.getName() +
                             ", hashIdResolverClass=" + hashIdRslvr.getClass().getName() +
", existingNodeId=" +
                             topNode.id() + ']';
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bbcda443/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityHashIdResolverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityHashIdResolverSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityHashIdResolverSelfTest.java
index a27c486..83a3e65 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityHashIdResolverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedAffinityHashIdResolverSelfTest.java
@@ -76,11 +76,7 @@ public class GridCachePartitionedAffinityHashIdResolverSelfTest extends
GridComm
      * @throws Exception If failed.
      */
     public void testDuplicateId() throws Exception {
-        rslvr = new CacheAffinityNodeHashResolver() {
-            @Override public Object resolve(ClusterNode node) {
-                return 1;
-            }
-        };
+        rslvr = new BogusHashResolver();
 
         startGrid(0);
 
@@ -93,4 +89,14 @@ public class GridCachePartitionedAffinityHashIdResolverSelfTest extends
GridComm
         }, IgniteCheckedException.class, "Failed to start manager: GridManagerAdapter [enabled=true,
name=" +
             "org.apache.ignite.internal.managers.discovery.GridDiscoveryManager]");
     }
+
+    /**
+     *
+     */
+    private static class BogusHashResolver implements CacheAffinityNodeHashResolver {
+        /** {@inheritDoc} */
+        @Override public Object resolve(ClusterNode node) {
+            return 1;
+        }
+    }
 }


Mime
View raw message