ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/6] incubator-ignite git commit: # ignite-787
Date Thu, 23 Apr 2015 10:34:53 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-656 3fc44aa89 -> f910bb691


# ignite-787


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

Branch: refs/heads/ignite-656
Commit: a5668b0d16c109d88c77e00c41cf0009c35b22ea
Parents: 3d90d84
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Apr 22 16:39:43 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Apr 22 16:41:28 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAffinityManager.java      | 12 ------------
 .../cache/affinity/GridCacheAffinityImpl.java           |  2 +-
 .../dht/preloader/GridDhtPartitionSupplyPool.java       |  2 +-
 .../cache/distributed/near/GridNearAtomicCache.java     |  2 +-
 .../distributed/near/GridNearTransactionalCache.java    |  2 +-
 .../cache/transactions/IgniteTxLocalAdapter.java        |  2 +-
 .../IgniteCachePutGetRestartAbstractTest.java           |  2 +-
 .../ignite/testsuites/IgniteCacheFailoverTestSuite.java |  2 +-
 8 files changed, 7 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5668b0d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
index b9e2f99..fe7efd5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
@@ -303,18 +303,6 @@ public class GridCacheAffinityManager extends GridCacheManagerAdapter
{
     }
 
     /**
-     * @param node Node.
-     * @param key Key to check.
-     * @param topVer Topology version.
-     * @return {@code true} if given key belongs to specified node.
-     */
-    public boolean belongs(ClusterNode node, Object key, AffinityTopologyVersion topVer)
{
-        assert node != null;
-
-        return belongs(node, partition(key), topVer);
-    }
-
-    /**
      * @param nodeId Node ID.
      * @param topVer Topology version to calculate affinity.
      * @return Partitions for which given node is primary.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5668b0d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
index a539a14..0186a90 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityImpl.java
@@ -77,7 +77,7 @@ public class GridCacheAffinityImpl<K, V> implements Affinity<K>
{
     @Override public boolean isPrimaryOrBackup(ClusterNode n, K key) {
         A.notNull(n, "n", key, "key");
 
-        return cctx.affinity().belongs(n, key, topologyVersion());
+        return cctx.affinity().belongs(n, cctx.affinity().partition(key), topologyVersion());
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5668b0d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyPool.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyPool.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyPool.java
index 74c1f33..5d9677d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyPool.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyPool.java
@@ -253,7 +253,7 @@ class GridDhtPartitionSupplyPool<K, V> {
                 // much time.
                 cctx.mvcc().finishLocks(d.topologyVersion()).get();
 
-                for (Integer part : d.partitions()) {
+                for (int part : d.partitions()) {
                     GridDhtLocalPartition loc = top.localPartition(part, d.topologyVersion(),
false);
 
                     if (loc == null || loc.state() != OWNING || !loc.reserve()) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5668b0d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
index 786f028..0d04a02f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -134,7 +134,7 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K,
V> {
             if (F.contains(failed, key))
                 continue;
 
-            if (ctx.affinity().belongs(ctx.localNode(), key, req.topologyVersion())) { //
Reader became backup.
+            if (ctx.affinity().belongs(ctx.localNode(), ctx.affinity().partition(key), req.topologyVersion()))
{ // Reader became backup.
                 GridCacheEntryEx entry = peekEx(key);
 
                 if (entry != null && entry.markObsolete(ver))

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5668b0d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
index a0197c7..9a36b36 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
@@ -438,7 +438,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K,
V>
      * @return {@code True} if entry is locally mapped as a primary or back up node.
      */
     protected boolean isNearLocallyMapped(GridCacheEntryEx e, AffinityTopologyVersion topVer)
{
-        return ctx.affinity().belongs(ctx.localNode(), e.key(), topVer);
+        return ctx.affinity().belongs(ctx.localNode(), e.partition(), topVer);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5668b0d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 1578d1b..5bd4fdf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -1340,7 +1340,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                     }
                     finally {
                         if (cacheCtx.isNear() && entry != null && readCommitted())
{
-                            if (cacheCtx.affinity().belongs(cacheCtx.localNode(), entry.key(),
topVer)) {
+                            if (cacheCtx.affinity().belongs(cacheCtx.localNode(), entry.partition(),
topVer)) {
                                 if (entry.markObsolete(xidVer))
                                     cacheCtx.cache().removeEntry(entry);
                             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5668b0d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePutGetRestartAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePutGetRestartAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePutGetRestartAbstractTest.java
index a56b0fa..60b6732 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePutGetRestartAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePutGetRestartAbstractTest.java
@@ -204,7 +204,7 @@ public abstract class IgniteCachePutGetRestartAbstractTest extends IgniteCacheAb
     private void readCache(IgniteCache<Integer, Integer> cache, IgniteTransactions
txs) {
         try (Transaction tx = txs.txStart(OPTIMISTIC, REPEATABLE_READ)) {
             for (int i = 0; i < ENTRY_CNT; i++)
-                assertEquals(expVal, cache.get(i));
+                assertNotNull(cache.get(i));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5668b0d/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
index 32e4134..6f2dd02 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
@@ -61,7 +61,7 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
         suite.addTestSuite(IgniteCacheTxNodeJoinTest.class);
         suite.addTestSuite(IgniteCacheTxFairAffinityNodeJoinTest.class);
 
-        //suite.addTestSuite(IgniteCacheTxNearDisabledPutGetRestartTest.class);
+        suite.addTestSuite(IgniteCacheTxNearDisabledPutGetRestartTest.class);
 
         return suite;
     }


Mime
View raw message