ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [45/50] incubator-ignite git commit: # ignite-sprint-4 fix for ignite-781
Date Tue, 21 Apr 2015 13:35:34 GMT
# ignite-sprint-4 fix for ignite-781


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

Branch: refs/heads/ignite-646
Commit: 1a27e88b2dbb41ae5fed1f64ce186a52704c0589
Parents: bb047b2
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Apr 21 15:15:35 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Apr 21 15:15:35 2015 +0300

----------------------------------------------------------------------
 .../dht/GridDhtAffinityAssignmentResponse.java  | 21 +++++++++++++++++++-
 .../distributed/dht/GridDhtTxFinishFuture.java  |  2 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java |  2 +-
 .../IgniteCacheFullApiSelfTestSuite.java        | 15 +++++++-------
 4 files changed, 29 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1a27e88b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
index 73b4a48..4fc1b87 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
@@ -25,6 +25,7 @@ import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.plugin.extensions.communication.*;
+import org.apache.ignite.spi.discovery.tcp.internal.*;
 import org.jetbrains.annotations.*;
 
 import java.nio.*;
@@ -112,11 +113,29 @@ public class GridDhtAffinityAssignmentResponse extends GridCacheMessage
{
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings("ForLoopReplaceableByForEach")
     @Override public void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws
IgniteCheckedException {
         super.finishUnmarshal(ctx, ldr);
 
-        if (affAssignmentBytes != null)
+        if (affAssignmentBytes != null) {
             affAssignment = ctx.marshaller().unmarshal(affAssignmentBytes, ldr);
+
+            // TODO IGNITE-10: setting 'local' for nodes not needed when IGNITE-10 is implemented.
+            int assignments = affAssignment.size();
+
+            for (int n = 0; n < assignments; n++) {
+                List<ClusterNode> nodes = affAssignment.get(n);
+
+                int size = nodes.size();
+
+                for (int i = 0; i < size; i++) {
+                    ClusterNode node = nodes.get(i);
+
+                    if (node instanceof TcpDiscoveryNode)
+                        ((TcpDiscoveryNode)node).local(node.id().equals(ctx.localNodeId()));
+                }
+            }
+        }
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1a27e88b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index 8e8a0a7..1340ba2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@ -425,7 +425,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
          * @param nearMapping nearMapping.
          */
         MiniFuture(GridDistributedTxMapping dhtMapping, GridDistributedTxMapping nearMapping)
{
-            assert dhtMapping == null || nearMapping == null || dhtMapping.node() == nearMapping.node();
+            assert dhtMapping == null || nearMapping == null || dhtMapping.node().equals(nearMapping.node());
 
             this.dhtMapping = dhtMapping;
             this.nearMapping = nearMapping;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1a27e88b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 551b2e4..2eb79fe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -1120,7 +1120,7 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
             GridDistributedTxMapping dhtMapping,
             GridDistributedTxMapping nearMapping
         ) {
-            assert dhtMapping == null || nearMapping == null || dhtMapping.node() == nearMapping.node();
+            assert dhtMapping == null || nearMapping == null || dhtMapping.node().equals(nearMapping.node());
 
             this.nodeId = nodeId;
             this.dhtMapping = dhtMapping;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1a27e88b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
index 92742f5..acf6c64 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiSelfTestSuite.java
@@ -90,14 +90,13 @@ public class IgniteCacheFullApiSelfTestSuite extends TestSuite {
         suite.addTestSuite(GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.class);
         suite.addTestSuite(GridCacheAtomicNearOnlyMultiNodeP2PDisabledFullApiSelfTest.class);
 
-        // Fair affinity. TODO IGNITE-781.
-        //suite.addTestSuite(GridCachePartitionedFairAffinityMultiNodeFullApiSelfTest.class);
-        //suite.addTestSuite(GridCachePartitionedNearDisabledFairAffinityMultiNodeFullApiSelfTest.class);
-        //suite.addTestSuite(GridCacheAtomicFairAffinityMultiNodeFullApiSelfTest.class);
-        //suite.addTestSuite(GridCacheAtomicNearEnabledFairAffinityMultiNodeFullApiSelfTest.class);
-        //suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderFairAffinityMultiNodeFullApiSelfTest.class);
-        //suite.addTestSuite(GridCacheNearOnlyFairAffinityMultiNodeFullApiSelfTest.class);
-        //suite.addTestSuite(GridCacheAtomicClientOnlyFairAffinityMultiNodeFullApiSelfTest.class);
+        suite.addTestSuite(GridCachePartitionedFairAffinityMultiNodeFullApiSelfTest.class);
+        suite.addTestSuite(GridCachePartitionedNearDisabledFairAffinityMultiNodeFullApiSelfTest.class);
+        suite.addTestSuite(GridCacheAtomicFairAffinityMultiNodeFullApiSelfTest.class);
+        suite.addTestSuite(GridCacheAtomicNearEnabledFairAffinityMultiNodeFullApiSelfTest.class);
+        suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderFairAffinityMultiNodeFullApiSelfTest.class);
+        suite.addTestSuite(GridCacheNearOnlyFairAffinityMultiNodeFullApiSelfTest.class);
+        suite.addTestSuite(GridCacheAtomicClientOnlyFairAffinityMultiNodeFullApiSelfTest.class);
 
         suite.addTestSuite(GridCacheNearReloadAllSelfTest.class);
         suite.addTestSuite(GridCacheColocatedReloadAllSelfTest.class);


Mime
View raw message