Fixed cache plugin validation.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3314a451 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3314a451 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3314a451 Branch: refs/heads/master Commit: 3314a4513c816c027dad80258ded1fe5a4c2b700 Parents: 3c88737 Author: sboikov <sboi...@gridgain.com> Authored: Fri Jul 7 17:28:47 2017 +0300 Committer: sboikov <sboi...@gridgain.com> Committed: Fri Jul 7 17:28:47 2017 +0300 ---------------------------------------------------------------------- .../processors/cache/ClusterCachesInfo.java | 30 +++++++++++++++++++- .../cache/DynamicCacheDescriptor.java | 13 --------- 2 files changed, 29 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/3314a451/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java index 738e4ac..949bc19 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java @@ -37,6 +37,7 @@ import org.apache.ignite.cache.CacheExistsException; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.NearCacheConfiguration; +import org.apache.ignite.internal.GridCachePluginContext; import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; @@ -53,6 +54,9 @@ import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.lang.IgniteUuid; +import org.apache.ignite.plugin.CachePluginContext; +import org.apache.ignite.plugin.CachePluginProvider; +import org.apache.ignite.plugin.PluginProvider; import org.apache.ignite.spi.discovery.DiscoveryDataBag; import org.jetbrains.annotations.Nullable; @@ -175,8 +179,32 @@ class ClusterCachesInfo { locCacheInfo.cacheData().config().getName()); } - if (checkConsistency) + if (checkConsistency) { checkCache(locCacheInfo, cacheData, cacheData.receivedFrom()); + + ClusterNode rmt = ctx.discovery().node(cacheData.receivedFrom()); + + if (rmt == null) { + for (ClusterNode node : ctx.discovery().localJoin().discoCache().serverNodes()) { + if (!node.isLocal() && ctx.discovery().cacheAffinityNode(node, locCfg.getName())) { + rmt = node; + + break; + } + } + } + + if (rmt != null) { + for (PluginProvider p : ctx.plugins().allProviders()) { + CachePluginContext pluginCtx = new GridCachePluginContext(ctx, locCfg); + + CachePluginProvider provider = p.createCacheProvider(pluginCtx); + + if (provider != null) + provider.validateRemote(locCfg, cacheData.cacheConfiguration(), rmt); + } + } + } } if (checkConsistency) http://git-wip-us.apache.org/repos/asf/ignite/blob/3314a451/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 315013d..18abcd8 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 @@ -24,7 +24,6 @@ import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cacheobject.IgniteCacheObjectProcessor; -import org.apache.ignite.internal.processors.plugin.CachePluginManager; import org.apache.ignite.internal.processors.query.QuerySchema; import org.apache.ignite.internal.processors.query.schema.message.SchemaFinishDiscoveryMessage; import org.apache.ignite.internal.util.tostring.GridToStringExclude; @@ -57,9 +56,6 @@ public class DynamicCacheDescriptor { /** Template configuration flag. */ private boolean template; - /** Cache plugin manager. */ - private final CachePluginManager pluginMgr; - /** */ private boolean updatesAllowed = true; @@ -138,8 +134,6 @@ public class DynamicCacheDescriptor { this.sql = sql; this.deploymentId = deploymentId; - pluginMgr = new CachePluginManager(ctx, cacheCfg); - cacheId = CU.cacheId(cacheCfg.getName()); synchronized (schemaMux) { @@ -242,13 +236,6 @@ public class DynamicCacheDescriptor { } /** - * @return Cache plugin manager. - */ - public CachePluginManager pluginManager() { - return pluginMgr; - } - - /** * @return Updates allowed flag. */ public boolean updatesAllowed() {