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/05/06 12:24:48 UTC

[17/18] incubator-ignite git commit: ignite-862: Fixed.

ignite-862: Fixed.


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

Branch: refs/heads/ignite-841
Commit: d4908f2449a4fde9298f6ca11590e0a94a94c955
Parents: 7be25bd
Author: Artem Shutak <as...@gridgain.com>
Authored: Wed May 6 12:58:08 2015 +0300
Committer: Artem Shutak <as...@gridgain.com>
Committed: Wed May 6 12:58:08 2015 +0300

----------------------------------------------------------------------
 .../cache/DynamicCacheDescriptor.java           | 16 ++++++++++-
 .../processors/cache/GridCacheProcessor.java    | 30 ++++++--------------
 2 files changed, 24 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d4908f24/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
index d8da9ef..6f6f422 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
@@ -18,6 +18,8 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.plugin.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
@@ -56,13 +58,17 @@ public class DynamicCacheDescriptor {
     /** Template configuration flag. */
     private boolean template;
 
+    /** Cache plugin manager. */
+    private final CachePluginManager pluginMgr;
+
     /**
      * @param cacheCfg Cache configuration.
      * @param cacheType Cache type.
      * @param template {@code True} if this is template configuration.
      * @param deploymentId Deployment ID.
      */
-    public DynamicCacheDescriptor(CacheConfiguration cacheCfg,
+    public DynamicCacheDescriptor(GridKernalContext ctx,
+        CacheConfiguration cacheCfg,
         CacheType cacheType,
         boolean template,
         IgniteUuid deploymentId) {
@@ -70,6 +76,7 @@ public class DynamicCacheDescriptor {
         this.cacheType = cacheType;
         this.template = template;
         this.deploymentId = deploymentId;
+        pluginMgr = new CachePluginManager(ctx, cacheCfg);
     }
 
     /**
@@ -149,6 +156,13 @@ public class DynamicCacheDescriptor {
     }
 
     /**
+     * @return Cache plugin manager.
+     */
+    public CachePluginManager pluginManager() {
+        return pluginMgr;
+    }
+
+    /**
      * Sets cancelled flag.
      */
     public void onCancelled() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d4908f24/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 d22d224..2b9a821 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
@@ -610,7 +610,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
             boolean template = cfg.getName() != null && cfg.getName().endsWith("*");
 
-            DynamicCacheDescriptor desc = new DynamicCacheDescriptor(cfg, cacheType, template, IgniteUuid.randomUuid());
+            DynamicCacheDescriptor desc = new DynamicCacheDescriptor(ctx, cfg, cacheType, template,
+                IgniteUuid.randomUuid());
 
             desc.locallyConfigured(true);
             desc.staticallyConfigured(true);
@@ -638,7 +639,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
             if (cfg.getName() == null) { // Use cache configuration with null name as template.
                 DynamicCacheDescriptor desc0 =
-                    new DynamicCacheDescriptor(cfg, cacheType, true, IgniteUuid.randomUuid());
+                    new DynamicCacheDescriptor(ctx, cfg, cacheType, true, IgniteUuid.randomUuid());
 
                 desc0.locallyConfigured(true);
                 desc0.staticallyConfigured(true);
@@ -666,17 +667,6 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
             ClusterNode locNode = ctx.discovery().localNode();
 
-            // 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()) {
                     checkTransactionConfiguration(n);
@@ -696,9 +686,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                             checkCache(locCfg, rmtCfg, n);
 
                             // Check plugin cache configurations.
-                            CachePluginManager pluginMgr = cache2PluginMgr.get(locCfg.getName());
-
-                            assert pluginMgr != null : " Map=" + cache2PluginMgr;
+                            CachePluginManager pluginMgr = desc.pluginManager();
 
                             pluginMgr.validateRemotes(rmtCfg, n);
                         }
@@ -721,9 +709,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                 if (filter.apply(locNode)) {
                     CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(ccfg);
 
-                    CachePluginManager pluginMgr = cache2PluginMgr.get(ccfg.getName());
-
-                    assert pluginMgr != null : " Map=" + cache2PluginMgr;
+                    CachePluginManager pluginMgr = desc.pluginManager();
 
                     GridCacheContext ctx = createCache(ccfg, pluginMgr, desc.cacheType(), cacheObjCtx);
 
@@ -1657,6 +1643,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
                     if (existing == null) {
                         DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
+                            ctx,
                             ccfg,
                             req.cacheType(),
                             true,
@@ -1690,6 +1677,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                         assert req.cacheType() != null : req;
 
                         DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
+                            ctx,
                             ccfg,
                             req.cacheType(),
                             false,
@@ -2039,7 +2027,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
 
                 if (desc == null) {
                     DynamicCacheDescriptor templateDesc =
-                        new DynamicCacheDescriptor(ccfg, req.cacheType(), true, req.deploymentId());
+                        new DynamicCacheDescriptor(ctx, ccfg, req.cacheType(), true, req.deploymentId());
 
                     DynamicCacheDescriptor old = registeredTemplates.put(maskNull(ccfg.getName()), templateDesc);
 
@@ -2093,7 +2081,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                     assert req.cacheType() != null : req;
 
                     DynamicCacheDescriptor startDesc =
-                        new DynamicCacheDescriptor(ccfg, req.cacheType(), false, req.deploymentId());
+                        new DynamicCacheDescriptor(ctx, ccfg, req.cacheType(), false, req.deploymentId());
 
                     DynamicCacheDescriptor old = registeredCaches.put(maskNull(ccfg.getName()), startDesc);