ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [9/9] incubator-ignite git commit: #ignite-sprint-4-tests: debug query tests.
Date Tue, 21 Apr 2015 09:07:37 GMT
#ignite-sprint-4-tests: debug query tests.


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

Branch: refs/heads/ignite-sprint-4-tests
Commit: 647798848c24c7fb7d8f80f419d2c8bf58997201
Parents: 5b0b6c5
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Tue Apr 21 12:07:23 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Tue Apr 21 12:07:23 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheEvictionManager.java    | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/64779884/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 826eb1b..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,7 +915,7 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter
{
 
         List<GridCacheEntryEx> locked = new ArrayList<>(keys.size());
 
-        List<GridCacheEntryEx> toRemove = new ArrayList<>(keys.size());
+        Set<GridCacheEntryEx> notRemove = null;
 
         Collection<GridCacheBatchSwapEntry> swapped = new ArrayList<>(keys.size());
 
@@ -946,8 +946,12 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter
{
 
                 locked.add(entry);
 
-                if (!entry.obsolete())
-                    toRemove.add(entry);
+                if (entry.obsolete()) {
+                    if (notRemove == null)
+                        notRemove = new HashSet<>();
+
+                    notRemove.add(entry);
+                }
 
                 if (obsoleteVer == null)
                     obsoleteVer = cctx.versions().next();
@@ -975,8 +979,8 @@ public class GridCacheEvictionManager extends GridCacheManagerAdapter
{
             }
 
             // Remove entries and fire events outside the locks.
-            for (GridCacheEntryEx entry : toRemove) {
-                if (entry.obsolete()) {
+            for (GridCacheEntryEx entry : locked) {
+                if (entry.obsolete() && (notRemove == null || !notRemove.contains(entry)))
{
                     entry.onMarkedObsolete();
 
                     cache.removeEntry(entry);


Mime
View raw message