#ignite-683: Remove filters from CacheProjection removeAllAsync.

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

Branch: refs/heads/ignite-683
Commit: 8d70d11fa45482c1640da2d6d1170b2527593b77
Parents: 10bd6d2
Author: ivasilinets <ivasilin...@gridgain.com>
Authored: Wed Apr 8 00:41:42 2015 +0300
Committer: ivasilinets <ivasilin...@gridgain.com>
Committed: Wed Apr 8 00:41:42 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/CacheProjection.java    | 10 ++--------
 .../internal/processors/cache/GridCacheAdapter.java   | 14 ++++++--------
 .../processors/cache/GridCacheProjectionImpl.java     | 10 ++++------
 .../internal/processors/cache/GridCacheProxyImpl.java | 10 ++++------
 .../distributed/dht/atomic/GridDhtAtomicCache.java    | 12 +++++-------
 .../cache/distributed/near/GridNearAtomicCache.java   |  9 ++++-----
 .../cache/local/atomic/GridLocalAtomicCache.java      | 10 ++++------
 7 files changed, 29 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d70d11f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
index 5feaadb..751da4a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheProjection.java
@@ -1299,12 +1299,9 @@ public interface CacheProjection<K, V> extends 
Iterable<Cache.Entry<K, V>> {
      * if there is one.
      *
      * @param keys Keys whose mappings are to be removed from cache.
-     * @param filter Optional filter to check prior to removing value form 
cache. Note
-     *      that filter is checked atomically together with remove operation.
      * @throws IgniteCheckedException If remove failed.
      */
-    public void removeAll(@Nullable Collection<? extends K> keys,
-        @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException;
+    public void removeAll(@Nullable Collection<? extends K> keys) throws 
IgniteCheckedException;
 
     /**
      * Asynchronously removes given key mappings from cache for entries for 
which the optionally
@@ -1317,13 +1314,10 @@ public interface CacheProjection<K, V> extends 
Iterable<Cache.Entry<K, V>> {
      * if there is one.
      *
      * @param keys Keys whose mappings are to be removed from cache.
-     * @param filter Optional filter to check prior to removing value form 
cache. Note
-     *      that filter is checked atomically together with remove operation.
      * @return Future for the remove operation. The future will complete 
whenever
      *      remove operation completes.
      */
-    public IgniteInternalFuture<?> removeAllAsync(@Nullable Collection<? 
extends K> keys,
-        @Nullable CacheEntryPredicate... filter);
+    public IgniteInternalFuture<?> removeAllAsync(@Nullable Collection<? 
extends K> keys);
 
     /**
      * Removes mappings from cache for entries for which the optionally passed 
in filters do

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d70d11f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 8a7b639..95fd3fd 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -2925,8 +2925,7 @@ public abstract class GridCacheAdapter<K, V> implements 
GridCache<K, V>,
     }
 
     /** {@inheritDoc} */
-    @Override public void removeAll(final Collection<? extends K> keys,
-        final CacheEntryPredicate... filter) throws IgniteCheckedException {
+    @Override public void removeAll(final Collection<? extends K> keys) throws 
IgniteCheckedException {
         boolean statsEnabled = ctx.config().isStatisticsEnabled();
 
         long start = statsEnabled ? System.nanoTime() : 0L;
@@ -2941,11 +2940,11 @@ public abstract class GridCacheAdapter<K, V> implements 
GridCache<K, V>,
 
         syncOp(new SyncInOp(keys.size() == 1) {
             @Override public void inOp(IgniteTxLocalAdapter tx) throws 
IgniteCheckedException {
-                tx.removeAllAsync(ctx, keys, null, false, filter).get();
+                tx.removeAllAsync(ctx, keys, null, false, CU.empty0()).get();
             }
 
             @Override public String toString() {
-                return "removeAll [keys=" + keys + ", filter=" + 
Arrays.toString(filter) + ']';
+                return "removeAll [keys=" + keys + ']';
             }
         });
 
@@ -2954,8 +2953,7 @@ public abstract class GridCacheAdapter<K, V> implements 
GridCache<K, V>,
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<?> removeAllAsync(@Nullable final 
Collection<? extends K> keys,
-        final CacheEntryPredicate... filter) {
+    @Override public IgniteInternalFuture<?> removeAllAsync(@Nullable final 
Collection<? extends K> keys) {
         final boolean statsEnabled = ctx.config().isStatisticsEnabled();
 
         final long start = statsEnabled ? System.nanoTime() : 0L;
@@ -2968,11 +2966,11 @@ public abstract class GridCacheAdapter<K, V> implements 
GridCache<K, V>,
 
         IgniteInternalFuture<Object> fut = asyncOp(new AsyncInOp(keys) {
             @Override public IgniteInternalFuture<?> inOp(IgniteTxLocalAdapter 
tx) {
-                return tx.removeAllAsync(ctx, keys, null, false, 
filter).chain(RET2NULL);
+                return tx.removeAllAsync(ctx, keys, null, false, 
CU.empty0()).chain(RET2NULL);
             }
 
             @Override public String toString() {
-                return "removeAllAsync [keys=" + keys + ", filter=" + 
Arrays.toString(filter) + ']';
+                return "removeAllAsync [keys=" + keys + ']';
             }
         });
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d70d11f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
index edf0943..615a6df 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
@@ -750,15 +750,13 @@ public class GridCacheProjectionImpl<K, V> implements 
GridCacheProjectionEx<K, V
     }
 
     /** {@inheritDoc} */
-    @Override public void removeAll(@Nullable Collection<? extends K> keys,
-        @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException 
{
-        cache.removeAll(keys, filter);
+    @Override public void removeAll(@Nullable Collection<? extends K> keys) 
throws IgniteCheckedException {
+        cache.removeAll(keys);
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<?> removeAllAsync(@Nullable 
Collection<? extends K> keys,
-        @Nullable CacheEntryPredicate[] filter) {
-        return cache.removeAllAsync(keys, filter);
+    @Override public IgniteInternalFuture<?> removeAllAsync(@Nullable 
Collection<? extends K> keys) {
+        return cache.removeAllAsync(keys);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d70d11f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index c2a7f91..3556b47 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -1516,12 +1516,11 @@ public class GridCacheProxyImpl<K, V> implements 
GridCacheProxy<K, V>, Externali
     }
 
     /** {@inheritDoc} */
-    @Override public void removeAll(@Nullable Collection<? extends K> keys,
-        @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException {
+    @Override public void removeAll(@Nullable Collection<? extends K> keys) 
throws IgniteCheckedException {
         GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
 
         try {
-            delegate.removeAll(keys, filter);
+            delegate.removeAll(keys);
         }
         finally {
             gate.leave(prev);
@@ -1529,12 +1528,11 @@ public class GridCacheProxyImpl<K, V> implements 
GridCacheProxy<K, V>, Externali
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<?> removeAllAsync(@Nullable 
Collection<? extends K> keys,
-        @Nullable CacheEntryPredicate[] filter) {
+    @Override public IgniteInternalFuture<?> removeAllAsync(@Nullable 
Collection<? extends K> keys) {
         GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
 
         try {
-            return delegate.removeAllAsync(keys, filter);
+            return delegate.removeAllAsync(keys);
         }
         finally {
             gate.leave(prev);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d70d11f/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 b31d37a..380b9a1 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
@@ -514,17 +514,15 @@ public class GridDhtAtomicCache<K, V> extends 
GridDhtCacheAdapter<K, V> {
     }
 
     /** {@inheritDoc} */
-    @Override public void removeAll(Collection<? extends K> keys,
-        CacheEntryPredicate... filter) throws IgniteCheckedException {
-        removeAllAsync(keys, filter).get();
+    @Override public void removeAll(Collection<? extends K> keys) throws 
IgniteCheckedException {
+        removeAllAsync(keys).get();
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<?> removeAllAsync(Collection<? 
extends K> keys,
-        CacheEntryPredicate[] filter) {
+    @Override public IgniteInternalFuture<?> removeAllAsync(Collection<? 
extends K> keys) {
         A.notNull(keys, "keys");
 
-        return removeAllAsync0(keys, null, false, false, 
filter).chain(RET2NULL);
+        return removeAllAsync0(keys, null, false, false, 
CU.empty0()).chain(RET2NULL);
     }
 
     /** {@inheritDoc} */
@@ -561,7 +559,7 @@ public class GridDhtAtomicCache<K, V> extends 
GridDhtCacheAdapter<K, V> {
 
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<?> 
localRemoveAll(CacheEntryPredicate filter) {
-        return removeAllAsync(keySet(filter), null);
+        return removeAllAsync(keySet(filter));
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d70d11f/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 61c8629..95807cc 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
@@ -582,15 +582,14 @@ public class GridNearAtomicCache<K, V> extends 
GridNearCacheAdapter<K, V> {
     }
 
     /** {@inheritDoc} */
-    @Override public void removeAll(Collection<? extends K> keys, 
CacheEntryPredicate... filter)
+    @Override public void removeAll(Collection<? extends K> keys)
         throws IgniteCheckedException {
-        dht.removeAll(keys, filter);
+        dht.removeAll(keys);
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<?> removeAllAsync(Collection<? 
extends K> keys,
-        CacheEntryPredicate[] filter) {
-        return dht.removeAllAsync(keys, filter);
+    @Override public IgniteInternalFuture<?> removeAllAsync(Collection<? 
extends K> keys) {
+        return dht.removeAllAsync(keys);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8d70d11f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index a5cfff5..273a078 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -346,8 +346,7 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public void removeAll(Collection<? extends K> keys,
-        CacheEntryPredicate... filter) throws IgniteCheckedException {
+    @Override public void removeAll(Collection<? extends K> keys) throws 
IgniteCheckedException {
         updateAllInternal(DELETE,
             keys,
             null,
@@ -355,14 +354,13 @@ public class GridLocalAtomicCache<K, V> extends 
GridCacheAdapter<K, V> {
             expiryPerCall(),
             false,
             false,
-            filter,
+            CU.empty0(),
             ctx.writeThrough());
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteInternalFuture<?> removeAllAsync(Collection<? 
extends K> keys,
-        CacheEntryPredicate[] filter) {
-        return removeAllAsync0(keys, false, false, filter).chain(RET2NULL);
+    @Override public IgniteInternalFuture<?> removeAllAsync(Collection<? 
extends K> keys) {
+        return removeAllAsync0(keys, false, false, 
CU.empty0()).chain(RET2NULL);
     }
 
     /** {@inheritDoc} */

Reply via email to