ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-1.5 Should not wait on preloader sync future for system caches callbacks.
Date Mon, 30 Nov 2015 10:15:50 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1537 0e5d35bae -> be66a0cd1


ignite-1.5 Should not wait on preloader sync future for system caches callbacks.


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

Branch: refs/heads/ignite-1537
Commit: be66a0cd1c4c062e920c6ae921fb7ce687b30bfc
Parents: 0e5d35b
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Nov 30 13:15:40 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Nov 30 13:15:40 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheContext.java      | 15 +++++++++++++
 .../GridCachePartitionExchangeManager.java      | 23 +++++---------------
 2 files changed, 21 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/be66a0cd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 4e755bc..5b4f22c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -1744,6 +1744,7 @@ public class GridCacheContext<K, V> implements Externalizable
{
      *
      * @param o Object to unwrap.
      * @param keepPortable Keep portable flag.
+     * @param cpy Copy value flag.
      * @return Unwrapped object.
      */
     public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) {
@@ -1762,6 +1763,8 @@ public class GridCacheContext<K, V> implements Externalizable
{
      * @return Cache object.
      */
     @Nullable public CacheObject toCacheObject(@Nullable Object obj) {
+        assert validObjectForCache(obj) : obj;
+
         return cacheObjects().toCacheObject(cacheObjCtx, obj, true);
     }
 
@@ -1770,10 +1773,22 @@ public class GridCacheContext<K, V> implements Externalizable
{
      * @return Cache key object.
      */
     public KeyCacheObject toCacheKeyObject(Object obj) {
+        assert validObjectForCache(obj) : obj;
+
         return cacheObjects().toCacheKeyObject(cacheObjCtx, obj, true);
     }
 
     /**
+     * @param obj Object.
+     * @return {@code False} if objects is not expected for cache.
+     */
+    private boolean validObjectForCache(Object obj) {
+        return obj == null ||
+            !CU.isUtilityCache(cacheName) ||
+            ctx.marshallerContext().isSystemType(obj.getClass().getName());
+    }
+
+    /**
      * @param bytes Bytes.
      * @return Cache key object.
      * @throws IgniteCheckedException If failed.

http://git-wip-us.apache.org/repos/asf/ignite/blob/be66a0cd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 875a4e8..b13a5af 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -592,18 +592,6 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
     }
 
     /**
-     * Gets maximum node version for the given topology version.
-     *
-     * @param topVer Topology version to get maximum node version for.
-     * @return Maximum node version.
-     */
-    public IgniteProductVersion maximumNodeVersion(AffinityTopologyVersion topVer) {
-        IgnitePair<IgniteProductVersion> vers = nodeVers.get(topVer);
-
-        return vers == null ? cctx.localNode().version() : vers.get2();
-    }
-
-    /**
      * @return {@code true} if entered to busy state.
      */
     private boolean enterBusy() {
@@ -759,7 +747,10 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
                 GridDhtPartitionFullMap locMap = cacheCtx.topology().partitionMap(true);
 
                 if (useOldApi) {
-                    locMap = new GridDhtPartitionFullMap(locMap.nodeId(), locMap.nodeOrder(),
locMap.updateSequence(), locMap);
+                    locMap = new GridDhtPartitionFullMap(locMap.nodeId(),
+                        locMap.nodeOrder(),
+                        locMap.updateSequence(),
+                        locMap);
                 }
 
                 m.addFullPartitionsMap(cacheCtx.cacheId(), locMap);
@@ -1137,9 +1128,8 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
 
         dumpPendingObjects();
 
-        for (GridCacheContext cacheCtx : cctx.cacheContexts()) {
+        for (GridCacheContext cacheCtx : cctx.cacheContexts())
             cacheCtx.preloader().dumpDebugInfo();
-        }
     }
 
     /**
@@ -1405,9 +1395,8 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
                                 List<String> waitList = new ArrayList<>(size
- 1);
 
                                 for (List<Integer> cIds : orderMap.headMap(order).values())
{
-                                    for (Integer cId : cIds) {
+                                    for (Integer cId : cIds)
                                         waitList.add(cctx.cacheContext(cId).name());
-                                    }
                                 }
 
                                 Callable<Boolean> r = cacheCtx.preloader().addAssignments(


Mime
View raw message