You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/04/02 19:53:51 UTC

[1/2] incubator-ignite git commit: implement remote validation mechanism for CachePlugin

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-cacheplug-rmtvalid d6ca8a5b4 -> 9dda6bfc2


implement remote validation mechanism for CachePlugin


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

Branch: refs/heads/ignite-cacheplug-rmtvalid
Commit: 5b3c3214c02f2dbd3f975e16ecd1a505fe5722c2
Parents: d6ca8a5
Author: Artem Shutak <as...@gridgain.com>
Authored: Thu Apr 2 18:07:00 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Thu Apr 2 18:07:00 2015 +0300

----------------------------------------------------------------------
 .../configuration/CacheConfiguration.java       |  2 +-
 .../processors/cache/GridCacheProcessor.java    | 25 +++++++++++++++-----
 .../processors/plugin/CachePluginManager.java   |  1 +
 3 files changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5b3c3214/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 2ad4396..6de47c9 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -417,7 +417,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
     }
 
     /**
-     * Cache name. If not provided or {@code null}, then this will be considered a default
+     * Cache name or {@code null} if not provided, then this will be considered a default
      * cache which can be accessed via {@link Ignite#cache(String)} method. Otherwise, if name
      * is provided, the cache will be accessed via {@link Ignite#cache(String)} method.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5b3c3214/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 d06e6fb..380205f 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
@@ -626,7 +626,16 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
         ClusterNode locNode = ctx.discovery().localNode();
 
-        final Map<CacheConfiguration, CachePluginManager> ccfg2PluginMgr = new HashMap<>();
+        // Init cache plugin managers.
+        final Map<String, CachePluginManager> cache2PluginMgr = new HashMap<>();
+
+        for (DynamicCacheDescriptor desc : registeredCaches.values()) {
+            CacheConfiguration locCcfg = desc.cacheConfiguration();
+            
+            CachePluginManager pluginMgr = new CachePluginManager(ctx, locCcfg);
+
+            cache2PluginMgr.put(locCcfg.getName(), pluginMgr);
+        }
         
         if (!getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) {
             for (ClusterNode n : ctx.discovery().remoteNodes()) {
@@ -647,11 +656,11 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                         checkCache(locCfg, rmtCfg, n);
 
                         // Check plugin cache configurations.
-                        CachePluginManager pluginMgr = new CachePluginManager(ctx, locCfg);
-                        
+                        CachePluginManager pluginMgr = cache2PluginMgr.get(locCfg.getName());
+
+                        assert pluginMgr != null : " Map=" + cache2PluginMgr;
+
                         pluginMgr.validateRemotes(rmtCfg, n);
-                        
-                        ccfg2PluginMgr.put(locCfg, pluginMgr);
                     }
                 }
             }
@@ -672,7 +681,11 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             if (filter.apply(locNode)) {
                 CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(null, ccfg.getName(), ccfg);
 
-                GridCacheContext ctx = createCache(ccfg, ccfg2PluginMgr.get(ccfg), cacheObjCtx);
+                CachePluginManager pluginMgr = cache2PluginMgr.get(ccfg.getName());
+                
+                assert pluginMgr != null : " Map=" + cache2PluginMgr;
+                
+                GridCacheContext ctx = createCache(ccfg, pluginMgr, cacheObjCtx);
 
                 ctx.dynamicDeploymentId(desc.deploymentId());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5b3c3214/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/CachePluginManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/CachePluginManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/CachePluginManager.java
index 3496acd..96e5054 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/CachePluginManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/CachePluginManager.java
@@ -117,6 +117,7 @@ public class CachePluginManager extends GridCacheManagerAdapter {
      * @param rmtNode Remote rmtNode.
      * @throws IgniteCheckedException If failed.
      */
+    @SuppressWarnings("unchecked")
     public void validateRemotes(CacheConfiguration rmtCfg, ClusterNode rmtNode) throws IgniteCheckedException {
         for (Map.Entry<CachePluginContext, CachePluginProvider> entry : providersMap.entrySet()) {
             CachePluginContext cctx = entry.getKey();


[2/2] incubator-ignite git commit: implement remote validation mechanism for CachePlugin (remove equals and hashCode)

Posted by sb...@apache.org.
implement remote validation mechanism for CachePlugin (remove equals and hashCode)


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

Branch: refs/heads/ignite-cacheplug-rmtvalid
Commit: 9dda6bfc2eb3d30c38dc3572b8868d7bd2a19e0e
Parents: 5b3c321
Author: Artem Shutak <as...@gridgain.com>
Authored: Thu Apr 2 18:09:09 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Thu Apr 2 18:09:09 2015 +0300

----------------------------------------------------------------------
 .../configuration/CacheConfiguration.java       | 21 --------------------
 1 file changed, 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9dda6bfc/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 6de47c9..79c451c 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -1599,27 +1599,6 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
     }
 
     /** {@inheritDoc} */
-    @Override public boolean equals(Object o) {
-        if (this == o)
-            return true;
-        if (!(o instanceof CacheConfiguration))
-            return false;
-        if (!super.equals(o))
-            return false;
-
-        CacheConfiguration that = (CacheConfiguration)o;
-
-        return name == null ? that.name == null : name.equals(that.name);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int hashCode() {
-        int result = super.hashCode();
-        
-        return 31 * result + (name != null ? name.hashCode() : 0);
-    }
-
-    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(CacheConfiguration.class, this);
     }