ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [50/50] [abbrv] incubator-ignite git commit: IGNITE-54
Date Mon, 19 Jan 2015 14:21:27 GMT
IGNITE-54

Huge removeAll test
Remove some overrides


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

Branch: refs/heads/ignite-54
Commit: 9a1b041227f511d555749beb2c911ed88cb56990
Parents: 5a18570
Author: avinogradov <avinogradov@gridgain.com>
Authored: Mon Jan 19 17:19:03 2015 +0300
Committer: avinogradov <avinogradov@gridgain.com>
Committed: Mon Jan 19 17:19:03 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteCacheProxy.java       |  1 -
 .../processors/cache/GridCacheAdapter.java       |  3 ++-
 .../dht/atomic/GridDhtAtomicCache.java           |  5 -----
 .../distributed/near/GridNearAtomicCache.java    |  5 -----
 .../cache/local/atomic/GridLocalAtomicCache.java |  6 ------
 .../cache/GridCacheAbstractFullApiSelfTest.java  | 19 ++++++++++++++++++-
 6 files changed, 20 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9a1b0412/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 0c98124..346694e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -766,7 +766,6 @@ public class IgniteCacheProxy<K, V> extends IgniteAsyncSupportAdapter
implements
 
     /** {@inheritDoc} */
     @Override public void removeAll() {
-        // TODO IGNITE-1.
         GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
 
         try {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9a1b0412/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
index f9f4306..e7531c7 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
@@ -4910,7 +4910,8 @@ public abstract class GridCacheAdapter<K, V> extends GridMetadataAwareAdapter
im
                     keys.clear();
                 }
             }
-            cache.removeAll(keys);
+            if (!keys.isEmpty())
+                cache.removeAll(keys);
 
             return null;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9a1b0412/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index c3f1bf5..c690b31 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -510,11 +510,6 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
     }
 
     /** {@inheritDoc} */
-    @Override public void removeAll(IgnitePredicate<GridCacheEntry<K, V>>[] filter)
throws IgniteCheckedException {
-        removeAllAsync(filter).get();
-    }
-
-    /** {@inheritDoc} */
     @Override public IgniteFuture<?> removeAllAsync(IgnitePredicate<GridCacheEntry<K,
V>>[] filter) {
         return removeAllAsync(keySet(filter), filter);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9a1b0412/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearAtomicCache.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearAtomicCache.java
index 847e9f3..2ae47e3 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearAtomicCache.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -628,11 +628,6 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K,
V> {
     }
 
     /** {@inheritDoc} */
-    @Override public void removeAll(IgnitePredicate<GridCacheEntry<K, V>>[] filter)
throws IgniteCheckedException {
-        dht.removeAll(keySet(filter));
-    }
-
-    /** {@inheritDoc} */
     @Override public IgniteFuture<?> removeAllAsync(IgnitePredicate<GridCacheEntry<K,
V>>[] filter) {
         return dht.removeAllAsync(keySet(filter));
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9a1b0412/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/atomic/GridLocalAtomicCache.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/atomic/GridLocalAtomicCache.java
index 4312c81..78e4f80 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -453,12 +453,6 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K,
V> {
     }
 
     /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override public void removeAll(IgnitePredicate<GridCacheEntry<K, V>>[] filter)
throws IgniteCheckedException {
-        removeAll(keySet(filter));
-    }
-
-    /** {@inheritDoc} */
     @Override public IgniteFuture<?> removeAllAsync(IgnitePredicate<GridCacheEntry<K,
V>>[] filter) {
         return removeAllAsync(keySet(filter), filter);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9a1b0412/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 2fb802b..7685cf0 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -2483,6 +2483,23 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         cache().removeAll();
 
         assert cache().isEmpty();
+
+        long entryCount = hugeRemoveAllEntryCount();
+
+        for (int i = 0; i < entryCount; i++)
+            cache().put(String.valueOf(i), i);
+
+        for (int i = 0; i < entryCount; i++)
+            assertEquals(Integer.valueOf(i), cache().get(String.valueOf(i)));
+
+        cache().removeAll();
+
+        for (int i = 0; i < entryCount; i++)
+            assertNull(cache().get(String.valueOf(i)));
+    }
+
+    protected long hugeRemoveAllEntryCount(){
+        return 1000L;
     }
 
     /**
@@ -3095,7 +3112,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
                 }
             });
 
-            assertTrue(grid0.cache(null).isEmpty());
+            assertTrue("No entries " + g, grid0.cache(null).isEmpty());
         }
     }
 


Mime
View raw message