ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [5/5] incubator-ignite git commit: IGNITE-104 - Ordered ATOMIC updates
Date Fri, 31 Jul 2015 00:26:12 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/1e98372e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1e98372e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1e98372e

Branch: refs/heads/ignite-104
Commit: 1e98372edca990804d1686521fd152c0549baa2c
Parents: f187add
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Thu Jul 30 17:24:48 2015 -0700
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Thu Jul 30 17:24:48 2015 -0700

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheMapEntry.java  |  5 -----
 .../distributed/dht/atomic/GridDhtAtomicCache.java    |  9 +++------
 .../cache/distributed/near/GridNearAtomicCache.java   | 14 ++++----------
 3 files changed, 7 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e98372e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 79d7989..5d2af9a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -2161,9 +2161,6 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
                     }
                 }
 
-                if (!cctx.deferredDelete())
-                    markObsolete0(rmvVer, true);
-
                 res = hadVal;
             }
 
@@ -2458,8 +2455,6 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
 
     /** {@inheritDoc} */
     @Override public boolean markObsoleteVersion(GridCacheVersion ver) {
-        assert cctx.deferredDelete();
-
         boolean marked;
 
         synchronized (this) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e98372e/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 19c89e7..3802b29 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
@@ -1177,7 +1177,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                 }
             }
             catch (GridCacheEntryRemovedException e) {
-                assert !ctx.deferredDelete() : "Entry should not become obsolete while holding
lock.";
+                assert false : "Entry should not become obsolete while holding lock.";
 
                 e.printStackTrace();
             }
@@ -1196,11 +1196,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                         else {
                             GridDhtCacheEntry entry = e.get1();
 
-                            assert entry.obsolete();
-
-                            entry.onMarkedObsolete();
-
-                            removeEntry(entry);
+                            if (entry.markObsoleteVersion(e.get2()))
+                                removeEntry(entry);
                         }
                     }
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1e98372e/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 707facc..b3f4a1d 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
@@ -245,11 +245,8 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K,
V> {
                         if (ctx.deferredDelete())
                             ctx.onDeferredDelete(entry, updRes.removeVersion());
                         else {
-                            assert entry.obsolete();
-
-                            entry.onMarkedObsolete();
-
-                            removeEntry(entry);
+                            if (entry.markObsoleteVersion(updRes.removeVersion()))
+                                removeEntry(entry);
                         }
                     }
 
@@ -352,11 +349,8 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K,
V> {
                             if (ctx.deferredDelete())
                                 ctx.onDeferredDelete(entry, updRes.removeVersion());
                             else {
-                                assert entry.obsolete();
-
-                                entry.onMarkedObsolete();
-
-                                removeEntry(entry);
+                                if (entry.markObsoleteVersion(updRes.removeVersion()))
+                                    removeEntry(entry);
                             }
                         }
 


Mime
View raw message