IGNITE-45 - WIP

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

Branch: refs/heads/ignite-45
Commit: 647691f1789ff4b32e21245d03a7f3f6bcd0549a
Parents: 30d96ad
Author: Alexey Goncharuk <agoncha...@gridgain.com>
Authored: Tue Mar 3 19:33:01 2015 -0800
Committer: Alexey Goncharuk <agoncha...@gridgain.com>
Committed: Tue Mar 3 19:33:01 2015 -0800

----------------------------------------------------------------------
 .../cache/distributed/dht/GridDhtPartitionTopologyImpl.java  | 4 ++--
 .../dht/preloader/GridDhtPartitionExchangeId.java            | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/647691f1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index e86996d..8efd5eb 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -248,8 +248,8 @@ class GridDhtPartitionTopologyImpl<K, V> implements 
GridDhtPartitionTopology<K,
             if (cctx.preloadEnabled()) {
                 for (int p = 0; p < num; p++) {
                     // If this is the first node in grid.
-                    if (oldest.id().equals(loc.id()) && 
oldest.id().equals(exchId.nodeId())) {
-                        assert exchId.isJoined();
+                    if ((oldest.id().equals(loc.id()) && 
oldest.id().equals(exchId.nodeId())) || exchId.isCacheAdded()) {
+                        assert exchId.isJoined() || exchId.isCacheAdded();
 
                         try {
                             GridDhtLocalPartition<K, V> locPart = 
localPartition(p, topVer, true, false);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/647691f1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionExchangeId.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionExchangeId.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionExchangeId.java
index 1145bdb..0326444 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionExchangeId.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionExchangeId.java
@@ -107,6 +107,14 @@ public class GridDhtPartitionExchangeId implements 
Message, Comparable<GridDhtPa
         return evt == EVT_NODE_LEFT || evt == EVT_NODE_FAILED;
     }
 
+    /**
+     * @return {@code True} if cache was added with this exchange ID.
+     */
+    public boolean isCacheAdded() {
+        // TODO IGNITE-45 add cache added flag.
+        return evt == EVT_DISCOVERY_CUSTOM_EVT;
+    }
+
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         U.writeUuid(out, nodeId);

Reply via email to