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 2017/05/17 10:32:53 UTC

[14/17] ignite git commit: ignite-5075

ignite-5075


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

Branch: refs/heads/ignite-5075
Commit: cc3141588ef8e9b6acee5ff92b5996a4ee916ba5
Parents: 335216b
Author: sboikov <sb...@gridgain.com>
Authored: Wed May 17 11:17:03 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed May 17 11:17:03 2017 +0300

----------------------------------------------------------------------
 .../cache/CacheAffinitySharedManager.java       |  2 ++
 .../processors/cache/ClusterCachesInfo.java     | 34 +++++++++-----------
 .../cache/DynamicCacheDescriptor.java           | 26 +++++----------
 3 files changed, 26 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cc314158/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
index e10d385..cdc83ec 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
@@ -339,6 +339,8 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                     req.startCacheConfiguration(),
                     req.cacheType(),
                     false,
+                    action.descriptor().receivedFrom(),
+                    action.descriptor().staticallyConfigured(),
                     req.deploymentId(),
                     req.schema());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/cc314158/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 7d1e1a6..5552841 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
@@ -244,11 +244,11 @@ class ClusterCachesInfo {
                         ccfg,
                         req.cacheType(),
                         true,
+                        req.initiatingNodeId(),
+                        false,
                         req.deploymentId(),
                         req.schema());
 
-                    templateDesc.receivedFrom(req.initiatingNodeId());
-
                     DynamicCacheDescriptor old = registeredTemplates().put(ccfg.getName(), templateDesc);
 
                     assert old == null;
@@ -283,11 +283,11 @@ class ClusterCachesInfo {
                             ccfg,
                             req.cacheType(),
                             false,
+                            req.initiatingNodeId(),
+                            false,
                             req.deploymentId(),
                             req.schema());
 
-                        startDesc.receivedFrom(req.initiatingNodeId());
-
                         DynamicCacheDescriptor old = registeredCaches.put(ccfg.getName(), startDesc);
 
                         assert old == null;
@@ -618,12 +618,11 @@ class ClusterCachesInfo {
                 cacheData.cacheConfiguration(),
                 cacheData.cacheType(),
                 true,
+                cacheData.receivedFrom(),
+                cacheData.staticallyConfigured(),
                 cacheData.deploymentId(),
                 cacheData.schema());
 
-            desc.receivedFrom(cacheData.receivedFrom());
-            desc.staticallyConfigured(cacheData.staticallyConfigured());
-
             registeredTemplates.put(cacheData.cacheConfiguration().getName(), desc);
         }
 
@@ -635,12 +634,11 @@ class ClusterCachesInfo {
                 cacheData.cacheConfiguration(),
                 cacheData.cacheType(),
                 false,
+                cacheData.receivedFrom(),
+                cacheData.staticallyConfigured(),
                 cacheData.deploymentId(),
                 cacheData.schema());
 
-            desc.receivedFrom(cacheData.receivedFrom());
-            desc.staticallyConfigured(cacheData.staticallyConfigured());
-
             registeredCaches.put(cacheData.cacheConfiguration().getName(), desc);
 
             ctx.discovery().setCacheFilter(
@@ -663,6 +661,8 @@ class ClusterCachesInfo {
 
         if (!disconnectedState())
             initStartCachesForLocalJoin(false);
+        else
+            locJoinStartCaches = Collections.emptyList();
     }
 
     /**
@@ -691,14 +691,14 @@ class ClusterCachesInfo {
                             locCfg.config(),
                             desc.cacheType(),
                             desc.template(),
+                            desc.receivedFrom(),
+                            desc.staticallyConfigured(),
                             desc.deploymentId(),
                             desc.schema());
 
                     desc0.startTopologyVersion(desc.startTopologyVersion());
                     desc0.receivedFromStartVersion(desc.receivedFromStartVersion());
                     desc0.clientCacheStartVersion(desc.clientCacheStartVersion());
-                    desc0.receivedFrom(desc.receivedFrom());
-                    desc0.staticallyConfigured(desc.staticallyConfigured());
 
                     desc = desc0;
                 }
@@ -763,12 +763,11 @@ class ClusterCachesInfo {
                     cfg,
                     cacheInfo.cacheType(),
                     true,
+                    nodeId,
+                    true,
                     joinData.cacheDeploymentId(),
                     new QuerySchema(cfg.getQueryEntities()));
 
-                desc.staticallyConfigured(true);
-                desc.receivedFrom(nodeId);
-
                 DynamicCacheDescriptor old = registeredTemplates.put(cfg.getName(), desc);
 
                 assert old == null : old;
@@ -783,12 +782,11 @@ class ClusterCachesInfo {
                     cfg,
                     cacheInfo.cacheType(),
                     false,
+                    nodeId,
+                    true,
                     joinData.cacheDeploymentId(),
                     new QuerySchema(cfg.getQueryEntities()));
 
-                desc.staticallyConfigured(true);
-                desc.receivedFrom(nodeId);
-
                 DynamicCacheDescriptor old = registeredCaches.put(cfg.getName(), desc);
 
                 assert old == null : old;

http://git-wip-us.apache.org/repos/asf/ignite/blob/cc314158/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 cec1828..366ea7d 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
@@ -46,7 +46,7 @@ public class DynamicCacheDescriptor {
     private CacheConfiguration cacheCfg;
 
     /** Statically configured flag. */
-    private boolean staticCfg;
+    private final boolean staticCfg;
 
     /** Cache type. */
     private CacheType cacheType;
@@ -64,7 +64,7 @@ public class DynamicCacheDescriptor {
     private Integer cacheId;
 
     /** */
-    private UUID rcvdFrom;
+    private final UUID rcvdFrom;
 
     /** Mutex. */
     private final Object mux = new Object();
@@ -92,6 +92,8 @@ public class DynamicCacheDescriptor {
      * @param cacheCfg Cache configuration.
      * @param cacheType Cache type.
      * @param template {@code True} if this is template configuration.
+     * @param rcvdFrom ID of node provided cache configuration
+     * @param staticCfg {@code True} if cache statically configured.
      * @param deploymentId Deployment ID.
      */
     @SuppressWarnings("unchecked")
@@ -99,6 +101,8 @@ public class DynamicCacheDescriptor {
         CacheConfiguration cacheCfg,
         CacheType cacheType,
         boolean template,
+        UUID rcvdFrom,
+        boolean staticCfg,
         IgniteUuid deploymentId,
         QuerySchema schema) {
         assert cacheCfg != null;
@@ -113,6 +117,8 @@ public class DynamicCacheDescriptor {
         this.cacheCfg = cacheCfg;
         this.cacheType = cacheType;
         this.template = template;
+        this.rcvdFrom = rcvdFrom;
+        this.staticCfg = staticCfg;
         this.deploymentId = deploymentId;
 
         pluginMgr = new CachePluginManager(ctx, cacheCfg);
@@ -160,13 +166,6 @@ public class DynamicCacheDescriptor {
     }
 
     /**
-     * @param staticCfg {@code True} if statically configured.
-     */
-    public void staticallyConfigured(boolean staticCfg) {
-        this.staticCfg = staticCfg;
-    }
-
-    /**
      * @return Cache name.
      */
     public String cacheName() {
@@ -220,15 +219,6 @@ public class DynamicCacheDescriptor {
     }
 
     /**
-     * @param nodeId ID of node provided cache configuration in discovery data.
-     */
-    public void receivedFrom(UUID nodeId) {
-        assert nodeId != null;
-
-        rcvdFrom = nodeId;
-    }
-
-    /**
      * @return ID of node provided cache configuration in discovery data.
      */
     @Nullable public UUID receivedFrom() {