ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [13/13] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC updates
Date Fri, 07 Aug 2015 01:09:49 GMT
IGNITE-104 - Ordered ATOMIC updates


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

Branch: refs/heads/ignite-104
Commit: 99e998a8b46fc9e0ace50ac7c6c567beab69a47d
Parents: de86990e
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Thu Aug 6 18:09:08 2015 -0700
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Thu Aug 6 18:09:08 2015 -0700

----------------------------------------------------------------------
 .../processors/cache/GridCacheEvictionManager.java       | 11 ++++++++++-
 .../cache/distributed/dht/atomic/GridDhtAtomicCache.java |  2 +-
 .../cache/GridCacheAbstractFullApiSelfTest.java          | 11 +++--------
 .../GridCacheExpiredEntriesPreloadAbstractSelfTest.java  |  2 +-
 .../dht/GridCacheAtomicNearCacheSelfTest.java            |  4 ++--
 .../near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java  |  8 ++------
 6 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99e998a8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 55669a7..fb3639d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -740,11 +740,20 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter
{
      * @param topVer Topology version.
      */
     public void touch(GridCacheEntryEx e, AffinityTopologyVersion topVer) {
+        touch(e, topVer, null);
+    }
+
+    /**
+     * @param e Entry for eviction policy notification.
+     * @param topVer Topology version.
+     * @param ver Write version.
+     */
+    public void touch(GridCacheEntryEx e, AffinityTopologyVersion topVer, @Nullable GridCacheVersion
ver) {
         if (e.detached() || e.isInternal())
             return;
 
         try {
-            if (e.markObsoleteIfEmpty(null) || e.obsolete())
+            if (e.markObsoleteIfEmpty(ver) || e.obsolete())
                 e.context().cache().removeEntry(e);
         }
         catch (IgniteCheckedException ex) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99e998a8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 6949ae2..8ea4539 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -2497,7 +2497,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                     }
                     finally {
                         if (entry != null)
-                            ctx.evicts().touch(entry, req.topologyVersion());
+                            ctx.evicts().touch(entry, req.topologyVersion(), req.writeVersion());
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99e998a8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index b6348f2..fb004bf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -2317,8 +2317,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
                             GridCacheEntryEx entry = cctx.isNear() ? cctx.near().dht().peekEx(key)
:
                                 cctx.cache().peekEx(key);
 
-                            if (atomicityMode() != ATOMIC &&
-                                grid(idx).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(idx).localNode()))
{
+                            if (grid(idx).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(idx).localNode()))
{
                                 assertNotNull(entry);
                                 assertTrue(entry.deleted());
                             }
@@ -3395,12 +3394,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         // Ensure that old TTL and expire time are not longer "visible".
         entry = internalCache.peekEx(key);
 
-        if (atomicityMode() == ATOMIC)
-            assertNull(entry);
-        else {
-            assertEquals(0, entry.ttl());
-            assertEquals(0, entry.expireTime());
-        }
+        assertEquals(0, entry.ttl());
+        assertEquals(0, entry.expireTime());
 
         // Ensure that next update will not pick old expire time.
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99e998a8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
index 8b9373d..ccc9b64 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheExpiredEntriesPreloadAbstractSelfTest.java
@@ -105,7 +105,7 @@ public abstract class GridCacheExpiredEntriesPreloadAbstractSelfTest extends
Gri
 
         Collection<Event> evts = g1.events().localQuery(F.<Event>alwaysTrue(),
EVT_CACHE_REBALANCE_OBJECT_LOADED);
 
-        assertEquals("Expected all entries are preloaded.", cache1.isDhtAtomic() ? 0 : KEYS_NUM,
evts.size());
+        assertEquals("Expected all entries are preloaded.", KEYS_NUM, evts.size());
 
         boolean rmv = GridTestUtils.waitForCondition(new PAX() {
             @Override public boolean applyx() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99e998a8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
index 6d12f5e..2d28328 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java
@@ -668,7 +668,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest
{
         cache0.remove(nearKey); // Remove from grid0, this should remove readers on primary
node.
 
         for (int i = 0; i < GRID_CNT; i++)
-            checkEntry(grid(i), nearKey, null, false);
+            checkEntry(grid(i), nearKey, null, i == 0);
 
         Ignite primaryNode = G.ignite((String) aff.mapKeyToNode(nearKey).attribute(ATTR_GRID_NAME));
 
@@ -698,7 +698,7 @@ public class GridCacheAtomicNearCacheSelfTest extends GridCommonAbstractTest
{
 
         GridCacheEntryEx nearEntry = near.peekEx(key);
 
-        boolean expectDht = val != null && near.affinity().isPrimaryOrBackup(ignite.cluster().localNode(),
key);
+        boolean expectDht = near.affinity().isPrimaryOrBackup(ignite.cluster().localNode(),
key);
 
         if (expectNear) {
             assertNotNull("No near entry for: " + key + ", grid: " + ignite.name(), nearEntry);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99e998a8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
index 64bace5..6f8644f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
@@ -412,12 +412,8 @@ public class GridCacheNearOnlyMultiNodeFullApiSelfTest extends GridCachePartitio
 
             GridCacheEntryEx entry = dht.peekEx(key);
 
-            if (atomicityMode() == CacheAtomicityMode.ATOMIC)
-                assertNull(entry);
-            else {
-                assertEquals(0, entry.ttl());
-                assertEquals(0, entry.expireTime());
-            }
+            assertEquals(0, entry.ttl());
+            assertEquals(0, entry.expireTime());
         }
 
         // Ensure that next update will not pick old expire time.


Mime
View raw message