ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject ignite git commit: IGNITE-6778 Fixing sys cache restore logic
Date Thu, 02 Nov 2017 08:52:25 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-6778 44d582035 -> 0884500c1


IGNITE-6778 Fixing sys cache restore logic


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

Branch: refs/heads/ignite-6778
Commit: 0884500c1261f98f3a8b282eacf4329a272abb62
Parents: 44d5820
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Thu Nov 2 11:52:15 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Nov 2 11:52:15 2017 +0300

----------------------------------------------------------------------
 .../affinity/GridAffinityAssignmentCache.java       | 16 ++++++++++++++--
 .../internal/processors/cache/GridCacheUtils.java   | 13 +++++++++++++
 .../internal/processors/cache/StoredCacheData.java  |  9 +++++++++
 3 files changed, 36 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0884500c/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index cbc4eae..c451b77 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -589,8 +589,20 @@ public class GridAffinityAssignmentCache {
 
             IgniteInternalFuture<AffinityTopologyVersion> fut = readyFuture(topVer);
 
-            if (fut != null)
-                fut.get();
+            if (fut != null) {
+                Thread curTh = Thread.currentThread();
+
+                String threadName = curTh.getName();
+
+                try {
+                    curTh.setName(threadName + " (waiting " + topVer + ")");
+
+                    fut.get();
+                }
+                finally {
+                    curTh.setName(threadName);
+                }
+            }
         }
         catch (IgniteCheckedException e) {
             throw new IgniteException("Failed to wait for affinity ready future for topology
version: " + topVer,

http://git-wip-us.apache.org/repos/asf/ignite/blob/0884500c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 1f289d0..eb0d9aa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1686,6 +1686,19 @@ public class GridCacheUtils {
         if (dsCfg == null)
             return false;
 
+        // Special handling for system cache is needed.
+        if (isSystemCache(ccfg.getName())) {
+            if (dsCfg.getDefaultDataRegionConfiguration().isPersistenceEnabled())
+                return true;
+
+            for (DataRegionConfiguration drConf : dsCfg.getDataRegionConfigurations()) {
+                if (drConf.isPersistenceEnabled())
+                    return true;
+            }
+
+            return false;
+        }
+
         String regName = ccfg.getDataRegionName();
 
         if (regName == null || regName.equals(dsCfg.getDefaultDataRegionConfiguration().getName()))

http://git-wip-us.apache.org/repos/asf/ignite/blob/0884500c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java
index 39c3cd1..5a88036 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java
@@ -22,7 +22,9 @@ import java.util.Collection;
 import org.apache.ignite.cache.QueryEntity;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager;
+import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.internal.A;
+import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.marshaller.jdk.JdkMarshaller;
 
 /**
@@ -36,9 +38,11 @@ public class StoredCacheData implements Serializable {
     private static final long serialVersionUID = 0L;
 
     /** Cache configuration. */
+    @GridToStringInclude
     private final CacheConfiguration<?, ?> ccfg;
 
     /** Query entities. */
+    @GridToStringInclude
     private Collection<QueryEntity> qryEntities;
 
     /** SQL flag - {@code true} if cache was created with {@code CREATE TABLE}. */
@@ -90,4 +94,9 @@ public class StoredCacheData implements Serializable {
     public void sql(boolean sql) {
         this.sql = sql;
     }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(StoredCacheData.class, this);
+    }
 }


Mime
View raw message