ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [22/50] incubator-ignite git commit: #ignite-sprint-4: fix IgniteCacheQueryMultiThreadedSelfTest.
Date Thu, 23 Apr 2015 06:05:21 GMT
#ignite-sprint-4: fix IgniteCacheQueryMultiThreadedSelfTest.


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

Branch: refs/heads/ignite-80
Commit: fc8a98e6d81589d2641970dfec0a0609199c615b
Parents: bc025d9
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Tue Apr 21 13:43:00 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Tue Apr 21 13:43:00 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheEvictionManager.java       | 11 ++++++++++-
 .../cache/IgniteCacheQueryMultiThreadedSelfTest.java     |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc8a98e6/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 b0c9243..9135c16 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
@@ -915,6 +915,8 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter
{
 
         List<GridCacheEntryEx> locked = new ArrayList<>(keys.size());
 
+        Set<GridCacheEntryEx> notRemove = null;
+
         Collection<GridCacheBatchSwapEntry> swapped = new ArrayList<>(keys.size());
 
         boolean recordable = cctx.events().isRecordable(EVT_CACHE_ENTRY_EVICTED);
@@ -944,6 +946,13 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter
{
 
                 locked.add(entry);
 
+                if (entry.obsolete()) {
+                    if (notRemove == null)
+                        notRemove = new HashSet<>();
+
+                    notRemove.add(entry);
+                }
+
                 if (obsoleteVer == null)
                     obsoleteVer = cctx.versions().next();
 
@@ -971,7 +980,7 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter
{
 
             // Remove entries and fire events outside the locks.
             for (GridCacheEntryEx entry : locked) {
-                if (entry.obsolete()) {
+                if (entry.obsolete() && (notRemove == null || !notRemove.contains(entry)))
{
                     entry.onMarkedObsolete();
 
                     cache.removeEntry(entry);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fc8a98e6/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
index 51fc92d..66e2470 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java
@@ -193,6 +193,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes
 
             assertEquals("Swap keys: " + c.size(CachePeekMode.SWAP), 0, c.size(CachePeekMode.SWAP));
             assertEquals(0, c.size(CachePeekMode.OFFHEAP));
+            assertEquals(0, c.size(CachePeekMode.PRIMARY));
             assertEquals(0, c.size());
         }
     }


Mime
View raw message