Repository: ignite
Updated Branches:
  refs/heads/ignite-4154-2 e81079d01 -> f97ff6886


ignite-4154


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

Branch: refs/heads/ignite-4154-2
Commit: f97ff6886185bb3dd46114472c3a660327a0caba
Parents: e81079d
Author: sboikov <[email protected]>
Authored: Tue Nov 8 15:12:17 2016 +0300
Committer: sboikov <[email protected]>
Committed: Tue Nov 8 15:12:17 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCachePartitionExchangeManager.java  | 2 +-
 .../distributed/dht/preloader/GridDhtPartitionMap2.java      | 8 +++++---
 .../dht/preloader/GridDhtPartitionsFullMessage.java          | 5 ++++-
 .../dht/preloader/GridDhtPartitionsSingleMessage.java        | 7 +++++--
 4 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f97ff688/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 94a42a2..928500f 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
@@ -1023,7 +1023,7 @@ public class GridCachePartitionExchangeManager<K, V> 
extends GridCacheSharedMana
             if (state0 != null && state0.get2().equals(map.map())) {
                 dupDataCache = state0.get1();
 
-                map.map(Collections.<Integer, 
GridDhtPartitionState>emptyMap());
+                map.map(U.<Integer, GridDhtPartitionState>newHashMap(0));
             }
             else
                 dupData.put(affKey, new T2<>(cacheId, map.map()));

http://git-wip-us.apache.org/repos/asf/ignite/blob/f97ff688/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap2.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap2.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap2.java
index 930d5fa..dc308ba 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap2.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap2.java
@@ -112,9 +112,11 @@ public class GridDhtPartitionMap2 implements 
Comparable<GridDhtPartitionMap2>, E
      * @return Copy with empty partition state map.
      */
     public GridDhtPartitionMap2 emptyCopy() {
-        Map<Integer, GridDhtPartitionState> map = U.newHashMap(0);
-
-        return new GridDhtPartitionMap2(nodeId, updateSeq, top, map, moving);
+        return new GridDhtPartitionMap2(nodeId,
+            updateSeq,
+            top,
+            U.<Integer, GridDhtPartitionState>newHashMap(0),
+            moving);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/f97ff688/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
index 304c183..3d2d380 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
@@ -29,6 +29,7 @@ import org.apache.ignite.internal.GridDirectMap;
 import org.apache.ignite.internal.GridDirectTransient;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.internal.S;
@@ -244,12 +245,14 @@ public class GridDhtPartitionsFullMessage extends 
GridDhtPartitionsAbstractMessa
                         GridDhtPartitionMap2 partMap1 = map1.get(e0.getKey());
 
                         assert partMap1 != null && partMap1.map().isEmpty() : 
partMap1;
+                        assert !partMap1.hasMovingPartitions() : partMap1;
 
                         GridDhtPartitionMap2 partMap2 = e0.getValue();
 
                         assert partMap2 != null;
 
-                        partMap1.map(new HashMap<>(partMap2.map()));
+                        for (Map.Entry<Integer, GridDhtPartitionState> 
stateEntry : partMap2.entrySet())
+                            partMap1.put(stateEntry.getKey(), 
stateEntry.getValue());
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f97ff688/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
index 1fbcb6f..416d298 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
@@ -26,6 +26,7 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.GridDirectMap;
 import org.apache.ignite.internal.GridDirectTransient;
 import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.F;
@@ -200,7 +201,7 @@ public class GridDhtPartitionsSingleMessage extends 
GridDhtPartitionsAbstractMes
             if (compressed())
                 parts = U.unmarshalZip(ctx.marshaller(), partsBytes, 
U.resolveClassLoader(ldr, ctx.gridConfig()));
             else
-                parts =U.unmarshal(ctx, partsBytes, U.resolveClassLoader(ldr, 
ctx.gridConfig()));
+                parts = U.unmarshal(ctx, partsBytes, U.resolveClassLoader(ldr, 
ctx.gridConfig()));
         }
 
         if (partCntrsBytes != null && partCntrs == null) {
@@ -218,13 +219,15 @@ public class GridDhtPartitionsSingleMessage extends 
GridDhtPartitionsAbstractMes
 
                 assert map1 != null : e.getKey();
                 assert F.isEmpty(map1.map());
+                assert !map1.hasMovingPartitions();
 
                 GridDhtPartitionMap2 map2 = parts.get(e.getValue());
 
                 assert map2 != null : e.getValue();
                 assert map2.map() != null;
 
-                map1.map(new HashMap<>(map2.map()));
+                for (Map.Entry<Integer, GridDhtPartitionState> e0 : 
map2.map().entrySet())
+                    map1.put(e0.getKey(), e0.getValue());
             }
         }
     }

Reply via email to