ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: Moving index init operation between descriptor and request back and forth.
Date Tue, 14 Mar 2017 10:57:42 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-4565-ddl 09d102806 -> c30e4cf2f


Moving index init operation between descriptor and request back and forth.


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

Branch: refs/heads/ignite-4565-ddl
Commit: c30e4cf2f069adc8c4e69a558d58490281c326aa
Parents: 09d1028
Author: devozerov <vozerov@gridgain.com>
Authored: Tue Mar 14 13:57:34 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Tue Mar 14 13:57:34 2017 +0300

----------------------------------------------------------------------
 .../cache/CacheAffinitySharedManager.java         |  2 ++
 .../cache/DynamicCacheChangeRequest.java          | 18 ++++++++++++++++++
 .../processors/cache/GridCacheProcessor.java      | 14 +++++++-------
 3 files changed, 27 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c30e4cf2/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 d287188..abea10b 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
@@ -352,6 +352,8 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
                     false,
                     req.deploymentId());
 
+                desc.indexInitOperation(req.indexInitOperation());
+
                 DynamicCacheDescriptor old = registeredCaches.put(cacheId, desc);
 
                 assert old == null : old;

http://git-wip-us.apache.org/repos/asf/ignite/blob/c30e4cf2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
index d68f448..b446492 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java
@@ -22,6 +22,7 @@ import java.util.UUID;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.processors.query.ddl.AbstractIndexOperation;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.lang.IgniteUuid;
@@ -71,6 +72,9 @@ public class DynamicCacheChangeRequest implements Serializable {
     /** */
     private UUID rcvdFrom;
 
+    /** Index operation in init phase. */
+    private AbstractIndexOperation idxInitOp;
+
     /** */
     private transient boolean exchangeNeeded;
 
@@ -284,6 +288,20 @@ public class DynamicCacheChangeRequest implements Serializable {
         return rcvdFrom;
     }
 
+    /**
+     * @return Pending index init operation.
+     */
+    public AbstractIndexOperation indexInitOperation() {
+        return idxInitOp;
+    }
+
+    /**
+     * @param idxInitOp Pending index init operation.
+     */
+    public void indexInitOperation(AbstractIndexOperation idxInitOp) {
+        this.idxInitOp = idxInitOp;
+    }
+
     /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(DynamicCacheChangeRequest.class, this, "cacheName", cacheName());

http://git-wip-us.apache.org/repos/asf/ignite/blob/c30e4cf2/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 715ae6a..f2edbef 100755
--- 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
@@ -1981,12 +1981,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             DynamicCacheChangeRequest req = new DynamicCacheChangeRequest(desc.cacheConfiguration().getName(),
null);
 
             req.startCacheConfiguration(desc.cacheConfiguration());
-
             req.cacheType(desc.cacheType());
-
             req.deploymentId(desc.deploymentId());
-
             req.receivedFrom(desc.receivedFrom());
+            req.indexInitOperation(desc.indexInitOperation());
 
             reqs.add(req);
         }
@@ -2021,12 +2019,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             DynamicCacheChangeRequest req = new DynamicCacheChangeRequest(cache.name(), null);
 
             req.startCacheConfiguration(desc.cacheConfiguration());
-
             req.cacheType(desc.cacheType());
-
             req.deploymentId(desc.deploymentId());
-
             req.receivedFrom(desc.receivedFrom());
+            req.indexInitOperation(desc.indexInitOperation());
 
             reqs.add(req);
 
@@ -2142,6 +2138,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                                 false,
                                 req.deploymentId());
 
+                        desc.indexInitOperation(req.indexInitOperation());
+
                         // Received statically configured cache.
                         if (req.initiatingNodeId() == null)
                             desc.staticallyConfigured(true);
@@ -2850,6 +2848,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                         DynamicCacheDescriptor startDesc =
                             new DynamicCacheDescriptor(ctx, ccfg, req.cacheType(), false,
req.deploymentId());
 
+                        startDesc.indexInitOperation(req.indexInitOperation());
+
                         if (newTopVer == null) {
                             newTopVer = new AffinityTopologyVersion(topVer.topologyVersion(),
                                 topVer.minorTopologyVersion() + 1);
@@ -3911,8 +3911,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
                         req.clientStartOnly(true);
 
                     req.deploymentId(desc.deploymentId());
-
                     req.startCacheConfiguration(descCfg);
+                    req.indexInitOperation(desc.indexInitOperation());
                 }
             }
             else {


Mime
View raw message