Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0038F188F1 for ; Fri, 8 May 2015 10:27:59 +0000 (UTC) Received: (qmail 10056 invoked by uid 500); 8 May 2015 10:27:58 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 10023 invoked by uid 500); 8 May 2015 10:27:58 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 10010 invoked by uid 99); 8 May 2015 10:27:58 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 May 2015 10:27:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 3EE90C273E for ; Fri, 8 May 2015 10:27:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.79 X-Spam-Level: X-Spam-Status: No, score=0.79 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id hDwIn-ncu8QY for ; Fri, 8 May 2015 10:27:43 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 08220474F5 for ; Fri, 8 May 2015 10:27:36 +0000 (UTC) Received: (qmail 7924 invoked by uid 99); 8 May 2015 10:27:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 May 2015 10:27:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 84535E3CC1; Fri, 8 May 2015 10:27:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Fri, 08 May 2015 10:28:16 -0000 Message-Id: <599d953925da46279a2f3c9f1d2cd152@git.apache.org> In-Reply-To: <7b1c21317457432491c4c2d0ea944201@git.apache.org> References: <7b1c21317457432491c4c2d0ea944201@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [42/50] 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-471 Commit: d4908f2449a4fde9298f6ca11590e0a94a94c955 Parents: 7be25bd Author: Artem Shutak Authored: Wed May 6 12:58:08 2015 +0300 Committer: Artem Shutak 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 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);