ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [01/20] incubator-ignite git commit: # sprint-2 Remove non-valid near cache entries in removeAll()
Date Wed, 25 Mar 2015 12:02:25 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-341 57c09252b -> ccea39129


# sprint-2  Remove non-valid near cache entries in removeAll()


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

Branch: refs/heads/ignite-341
Commit: c25e37a63c3a26478eefbbf3fd86ccc42d379b3f
Parents: f78138e
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Mar 25 09:43:11 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Mar 25 09:43:11 2015 +0300

----------------------------------------------------------------------
 .../distributed/GridDistributedCacheAdapter.java    | 16 ++++++++++++++--
 .../GridCacheContinuousQueryAbstractSelfTest.java   |  3 +--
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c25e37a6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
index 132e584..b78e7e0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
@@ -278,9 +278,12 @@ public abstract class GridDistributedCacheAdapter<K, V> extends
GridCacheAdapter
                     return null; // Ignore this remove request because remove request will
be sent again.
 
                 GridDhtCacheAdapter<K, V> dht;
+                GridNearCacheAdapter<K, V> near = null;
 
-                if (cacheAdapter instanceof GridNearCacheAdapter)
-                    dht = ((GridNearCacheAdapter<K, V>)cacheAdapter).dht();
+                if (cacheAdapter instanceof GridNearCacheAdapter) {
+                    near = ((GridNearCacheAdapter<K, V>)cacheAdapter);
+                    dht = near.dht();
+                }
                 else
                     dht = (GridDhtCacheAdapter<K, V>)cacheAdapter;
 
@@ -309,6 +312,15 @@ public abstract class GridDistributedCacheAdapter<K, V> extends
GridCacheAdapter
                     while (it.hasNext())
                         dataLdr.removeDataInternal(it.next());
                 }
+
+                if (near != null) {
+                    GridCacheVersion obsoleteVer = ctx.versions().next();
+
+                    for (GridCacheEntryEx e : near.map().allEntries0()) {
+                        if (!e.valid(topVer) && e.markObsolete(obsoleteVer))
+                            near.removeEntry(e);
+                    }
+                }
             }
             finally {
                 ctx.gate().leave();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c25e37a6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index 86c1544..b333d9f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -132,8 +132,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends
GridCommo
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         GridTestUtils.waitForCondition(new PA() {
-            @Override
-            public boolean apply() {
+            @Override public boolean apply() {
                 for (int i = 0; i < gridCount(); i++) {
                     if (grid(i).cluster().nodes().size() != gridCount())
                         return false;


Mime
View raw message