Repository: incubator-ignite Updated Branches: refs/heads/ignite-683 ad77798de -> 6ecc11647
#ignite-683: remove Filters from CacheProjection. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6ecc1164 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6ecc1164 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6ecc1164 Branch: refs/heads/ignite-683 Commit: 6ecc11647e779b3960995369788df14a7e2881a0 Parents: ad77798 Author: ivasilinets <ivasilin...@gridgain.com> Authored: Mon Apr 6 16:18:16 2015 +0300 Committer: ivasilinets <ivasilin...@gridgain.com> Committed: Mon Apr 6 16:18:16 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/CacheProjection.java | 85 +--- .../processors/cache/GridCacheAdapter.java | 394 +++++++++++++++++-- .../cache/GridCacheProjectionImpl.java | 71 ++-- .../processors/cache/GridCacheProxyImpl.java | 67 ++-- 4 files changed, 426 insertions(+), 191 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6ecc1164/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 b17fdac..dcd3062 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 @@ -458,15 +458,13 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * * @param key Key to store in cache. * @param val Value to be associated with the given key. - * @param filter Optional filter to check prior to putting value in cache. Note - * that filter check is atomic with put operation. * @return Previous value associated with specified key, or {@code null} * if entry did not pass the filter, or if there was no mapping for the key in swap * or in persistent storage. * @throws NullPointerException If either key or value are {@code null}. * @throws IgniteCheckedException If put operation failed. */ - @Nullable public V put(K key, V val, @Nullable CacheEntryPredicate... filter) + @Nullable public V put(K key, V val) throws IgniteCheckedException; /** @@ -493,22 +491,15 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * * @param key Key to store in cache. * @param val Value to be associated with the given key. - * @param filter Optional filter to check prior to putting value in cache. Note - * that filter check is atomic with put operation. * @return Future for the put operation. * @throws NullPointerException If either key or value are {@code null}. */ - public IgniteInternalFuture<V> putAsync(K key, V val, @Nullable CacheEntryPredicate... filter); + public IgniteInternalFuture<V> putAsync(K key, V val); /** - * Stores given key-value pair in cache. If filters are provided, then entries will - * be stored in cache only if they pass the filter. Note that filter check is atomic, - * so value stored in cache is guaranteed to be consistent with the filters. + * Stores given key-value pair in cache. * <p> * This method will return {@code true} if value is stored in cache and {@code false} otherwise. - * Unlike <code>#put(Object, Object, org.apache.ignite.lang.IgnitePredicate[])</code> method, it does not return previous - * value and, therefore, does not have any overhead associated with returning a value. It - * should be used whenever return value is not required. * <p> * If write-through is enabled, the stored value will be persisted to {@link CacheStore} * via <code>CacheStore#put(Transaction, Object, Object)</code> method. @@ -518,26 +509,19 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * * @param key Key to store in cache. * @param val Value to be associated with the given key. - * @param filter Optional filter to check prior to putting value in cache. Note - * that filter check is atomic with put operation. * @return {@code True} if optional filter passed and value was stored in cache, * {@code false} otherwise. Note that this method will return {@code true} if filter is not * specified. * @throws NullPointerException If either key or value are {@code null}. * @throws IgniteCheckedException If put operation failed. */ - public boolean putx(K key, V val, @Nullable CacheEntryPredicate... filter) + public boolean putx(K key, V val) throws IgniteCheckedException; /** - * Stores given key-value pair in cache. If filters are provided, then entries will - * be stored in cache only if they pass the filter. Note that filter check is atomic, - * so value stored in cache is guaranteed to be consistent with the filters. + * Stores given key-value pair in cache. * <p> * This method will return {@code true} if value is stored in cache and {@code false} otherwise. - * Unlike <code>#put(Object, Object, org.apache.ignite.lang.IgnitePredicate[])</code> method, it does not return previous - * value and, therefore, does not have any overhead associated with returning of a value. It - * should always be used whenever return value is not required. * <p> * If write-through is enabled, the stored value will be persisted to {@link CacheStore} * via <code>CacheStore#put(Transaction, Object, Object)</code> method. @@ -547,14 +531,11 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * * @param key Key to store in cache. * @param val Value to be associated with the given key. - * @param filter Optional filter to check prior to putting value in cache. Note - * that filter check is atomic with put operation. - * @return Future for the put operation. Future will return {@code true} if optional filter - * passed and value was stored in cache, {@code false} otherwise. Note that future will - * return {@code true} if filter is not specified. + * @return Future for the put operation. Future will return {@code true} value was stored in cache, + * {@code false} otherwise. * @throws NullPointerException If either key or value are {@code null}. */ - public IgniteInternalFuture<Boolean> putxAsync(K key, V val, @Nullable CacheEntryPredicate... filter); + public IgniteInternalFuture<Boolean> putxAsync(K key, V val); /** * Stores given key-value pair in cache only if cache had no previous mapping for it. If cache @@ -800,12 +781,9 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * if there is one. * * @param m Key-value pairs to store in cache. - * @param filter Optional entry filter. If provided, then entry will - * be stored only if the filter returned {@code true}. * @throws IgniteCheckedException If put operation failed. */ - public void putAll(@Nullable Map<? extends K, ? extends V> m, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException; + public void putAll(@Nullable Map<? extends K, ? extends V> m) throws IgniteCheckedException; /** * Asynchronously stores given key-value pairs in cache. If filters are provided, then entries will @@ -819,12 +797,9 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * if there is one. * * @param m Key-value pairs to store in cache. - * @param filter Optional entry filter. If provided, then entry will - * be stored only if the filter returned {@code true}. * @return Future for putAll operation. */ - public IgniteInternalFuture<?> putAllAsync(@Nullable Map<? extends K, ? extends V> m, - @Nullable CacheEntryPredicate... filter); + public IgniteInternalFuture<?> putAllAsync(@Nullable Map<? extends K, ? extends V> m); /** * Set of keys cached on this node. You can remove elements from this set, but you cannot add elements @@ -842,23 +817,6 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { public Set<K> keySet(); /** - * Set of keys cached on this node. You can remove elements from this set, but you cannot add elements - * to this set. All removal operation will be reflected on the cache itself. - * <p> - * Iterator over this set will not fail if set was concurrently updated - * by another thread. This means that iterator may or may not return latest - * keys depending on whether they were added before or after current - * iterator position. - * <p> - * NOTE: this operation is not distributed and returns only the keys cached on this node. - * - * @param filter Optional filter to check prior to getting key form cache. Note - * that filter is checked atomically together with get operation. - * @return Key set for this cache projection. - */ - public Set<K> keySet(@Nullable CacheEntryPredicate... filter); - - /** * Set of keys for which this node is primary. * This set is dynamic and may change with grid topology changes. * Note that this set will contain mappings for all keys, even if their values are @@ -1184,14 +1142,12 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * if there is one. * * @param key Key whose mapping is 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 Previous value associated with specified key, or {@code null} * if there was no value for this key. * @throws NullPointerException If key is {@code null}. * @throws IgniteCheckedException If remove operation failed. */ - @Nullable public V remove(K key, @Nullable CacheEntryPredicate... filter) + @Nullable public V remove(K key) throws IgniteCheckedException; /** @@ -1213,12 +1169,10 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * if there is one. * * @param key Key whose mapping is 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. * @throws NullPointerException if the key is {@code null}. */ - public IgniteInternalFuture<V> removeAsync(K key, CacheEntryPredicate... filter); + public IgniteInternalFuture<V> removeAsync(K key); /** * Removes given key mapping from cache. @@ -1233,14 +1187,12 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * if there is one. * * @param key Key whose mapping is 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 {@code True} if filter passed validation and entry was removed, {@code false} otherwise. * Note that if filter is not specified, this method will return {@code true}. * @throws NullPointerException if the key is {@code null}. * @throws IgniteCheckedException If remove failed. */ - public boolean removex(K key, @Nullable CacheEntryPredicate... filter) + public boolean removex(K key) throws IgniteCheckedException; /** @@ -1256,15 +1208,12 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * if there is one. * * @param key Key whose mapping is 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 return {@code true} * if optional filters passed validation and remove did occur, {@code false} otherwise. * Note that if filter is not specified, this method will return {@code true}. * @throws NullPointerException if the key is {@code null}. */ - public IgniteInternalFuture<Boolean> removexAsync(K key, - @Nullable CacheEntryPredicate... filter); + public IgniteInternalFuture<Boolean> removexAsync(K key); /** * Removes given key mapping from cache if one exists and value is equal to the passed in value. @@ -1319,8 +1268,7 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * 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 @@ -1338,8 +1286,7 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * @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/6ecc1164/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 976c045..7145a39 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 @@ -946,7 +946,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@inheritDoc} */ @Override public Set<Cache.Entry<K, V>> entrySet() { - return entrySet((CacheEntryPredicate[])null); + return entrySet((CacheEntryPredicate[]) null); } /** {@inheritDoc} */ @@ -969,22 +969,22 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@inheritDoc} */ @Override public Set<Cache.Entry<K, V>> primaryEntrySet() { - return primaryEntrySet((CacheEntryPredicate[])null); + return primaryEntrySet((CacheEntryPredicate[]) null); } /** {@inheritDoc} */ @Override public Set<K> keySet() { - return keySet((CacheEntryPredicate[])null); + return keySet((CacheEntryPredicate[]) null); } /** {@inheritDoc} */ @Override public Set<K> primaryKeySet() { - return primaryKeySet((CacheEntryPredicate[])null); + return primaryKeySet((CacheEntryPredicate[]) null); } /** {@inheritDoc} */ @Override public Collection<V> values() { - return values((CacheEntryPredicate[])null); + return values((CacheEntryPredicate[]) null); } /** @@ -1325,7 +1325,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return getAllAsync(Collections.singletonList(key), /*force primary*/true, /*skip tx*/false, null, null, taskName, true, false).chain(new CX1<IgniteInternalFuture<Map<K, V>>, V>() { - @Override public V applyx(IgniteInternalFuture<Map<K, V>> e) throws IgniteCheckedException { + @Override + public V applyx(IgniteInternalFuture<Map<K, V>> e) throws IgniteCheckedException { return e.get().get(key); } }); @@ -1550,7 +1551,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@inheritDoc} */ @Override public void evictAll(Collection<? extends K> keys) { - evictAll(keys, (CacheEntryPredicate[])null); + evictAll(keys, (CacheEntryPredicate[]) null); } /** {@inheritDoc} */ @@ -1584,8 +1585,9 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, if (ctx.config().getInterceptor() != null) fut = fut.chain(new CX1<IgniteInternalFuture<V>, V>() { - @Override public V applyx(IgniteInternalFuture<V> f) throws IgniteCheckedException { - return (V)ctx.config().getInterceptor().onGet(key, f.get()); + @Override + public V applyx(IgniteInternalFuture<V> f) throws IgniteCheckedException { + return (V) ctx.config().getInterceptor().onGet(key, f.get()); } }); @@ -2016,7 +2018,42 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public V put(final K key, final V val, @Nullable final CacheEntryPredicate... filter) + @Override public V put(final K key, final V val) + throws IgniteCheckedException { + return put(key, val, null); + } + + /** + * Stores given key-value pair in cache. If filters are provided, then entries will + * be stored in cache only if they pass the filter. Note that filter check is atomic, + * so value stored in cache is guaranteed to be consistent with the filters. If cache + * previously contained value for the given key, then this value is returned. + * In case of {@link CacheMode#PARTITIONED} or {@link CacheMode#REPLICATED} caches, + * the value will be loaded from the primary node, which in its turn may load the value + * from the swap storage, and consecutively, if it's not in swap, + * from the underlying persistent storage. If value has to be loaded from persistent + * storage, <code>CacheStore#load(Transaction, Object)</code> method will be used. + * <p> + * If the returned value is not needed, method <code>#putx(Object, Object, org.apache.ignite.lang.IgnitePredicate[])</code> should + * always be used instead of this one to avoid the overhead associated with returning of the previous value. + * <p> + * If write-through is enabled, the stored value will be persisted to {@link org.apache.ignite.cache.store.CacheStore} + * via <code>CacheStore#put(Transaction, Object, Object)</code> method. + * <h2 class="header">Transactions</h2> + * This method is transactional and will enlist the entry into ongoing transaction + * if there is one. + * + * @param key Key to store in cache. + * @param val Value to be associated with the given key. + * @param filter Optional filter to check prior to putting value in cache. Note + * that filter check is atomic with put operation. + * @return Previous value associated with specified key, or {@code null} + * if entry did not pass the filter, or if there was no mapping for the key in swap + * or in persistent storage. + * @throws NullPointerException If either key or value are {@code null}. + * @throws IgniteCheckedException If put operation failed. + */ + public V put(final K key, final V val, @Nullable final CacheEntryPredicate... filter) throws IgniteCheckedException { boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2046,7 +2083,39 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<V> putAsync(final K key, final V val, + @Override public IgniteInternalFuture<V> putAsync(final K key, final V val) { + return putAsync(key, val, null); + } + /** + * Asynchronously stores given key-value pair in cache. If filters are provided, then entries will + * be stored in cache only if they pass the filter. Note that filter check is atomic, + * so value stored in cache is guaranteed to be consistent with the filters. If cache + * previously contained value for the given key, then this value is returned. Otherwise, + * in case of {@link CacheMode#REPLICATED} caches, the value will be loaded from swap + * and, if it's not there, and read-through is allowed, from the underlying + * {@link org.apache.ignite.cache.store.CacheStore} storage. In case of {@link CacheMode#PARTITIONED} caches, + * the value will be loaded from the primary node, which in its turn may load the value + * from the swap storage, and consecutively, if it's not in swap and read-through is allowed, + * from the underlying persistent storage. If value has to be loaded from persistent + * storage, <code>CacheStore#load(Transaction, Object)</code> method will be used. + * <p> + * If the returned value is not needed, method <code>#putx(Object, Object, org.apache.ignite.lang.IgnitePredicate[])</code> should + * always be used instead of this one to avoid the overhead associated with returning of the previous value. + * <p> + * If write-through is enabled, the stored value will be persisted to {@link org.apache.ignite.cache.store.CacheStore} + * via <code>CacheStore#put(Transaction, Object, Object)</code> method. + * <h2 class="header">Transactions</h2> + * This method is transactional and will enlist the entry into ongoing transaction + * if there is one. + * + * @param key Key to store in cache. + * @param val Value to be associated with the given key. + * @param filter Optional filter to check prior to putting value in cache. Note + * that filter check is atomic with put operation. + * @return Future for the put operation. + * @throws NullPointerException If either key or value are {@code null}. + */ + public IgniteInternalFuture<V> putAsync(final K key, final V val, @Nullable final CacheEntryPredicate[] filter) { final boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2077,7 +2146,37 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public boolean putx(final K key, final V val, + @Override public boolean putx(final K key, final V val) throws IgniteCheckedException { + return putx(key, val, null); + } + + /** + * Stores given key-value pair in cache. If filters are provided, then entries will + * be stored in cache only if they pass the filter. Note that filter check is atomic, + * so value stored in cache is guaranteed to be consistent with the filters. + * <p> + * This method will return {@code true} if value is stored in cache and {@code false} otherwise. + * Unlike <code>#put(Object, Object, org.apache.ignite.lang.IgnitePredicate[])</code> method, it does not return previous + * value and, therefore, does not have any overhead associated with returning a value. It + * should be used whenever return value is not required. + * <p> + * If write-through is enabled, the stored value will be persisted to {@link org.apache.ignite.cache.store.CacheStore} + * via <code>CacheStore#put(Transaction, Object, Object)</code> method. + * <h2 class="header">Transactions</h2> + * This method is transactional and will enlist the entry into ongoing transaction + * if there is one. + * + * @param key Key to store in cache. + * @param val Value to be associated with the given key. + * @param filter Optional filter to check prior to putting value in cache. Note + * that filter check is atomic with put operation. + * @return {@code True} if optional filter passed and value was stored in cache, + * {@code false} otherwise. Note that this method will return {@code true} if filter is not + * specified. + * @throws NullPointerException If either key or value are {@code null}. + * @throws IgniteCheckedException If put operation failed. + */ + public boolean putx(final K key, final V val, final CacheEntryPredicate[] filter) throws IgniteCheckedException { boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2134,11 +2233,13 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, ctx.dr().onReceiveCacheEntriesReceived(drMap.size()); return asyncOp(new AsyncInOp(drMap.keySet()) { - @Override public IgniteInternalFuture<?> inOp(IgniteTxLocalAdapter tx) { + @Override + public IgniteInternalFuture<?> inOp(IgniteTxLocalAdapter tx) { return tx.putAllDrAsync(ctx, drMap); } - @Override public String toString() { + @Override + public String toString() { return "putAllConflictAsync [drMap=" + drMap + ']'; } }); @@ -2187,14 +2288,17 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, validateCacheKeys(keys); return syncOp(new SyncOp<Map<K, EntryProcessorResult<T>>>(keys.size() == 1) { - @Nullable @Override public Map<K, EntryProcessorResult<T>> op(IgniteTxLocalAdapter tx) + @Nullable + @Override + public Map<K, EntryProcessorResult<T>> op(IgniteTxLocalAdapter tx) throws IgniteCheckedException { Map<? extends K, EntryProcessor<K, V, Object>> invokeMap = F.viewAsMap(keys, - new C1<K, EntryProcessor<K, V, Object>>() { - @Override public EntryProcessor apply(K k) { - return entryProcessor; - } - }); + new C1<K, EntryProcessor<K, V, Object>>() { + @Override + public EntryProcessor apply(K k) { + return entryProcessor; + } + }); IgniteInternalFuture<GridCacheReturn> fut = tx.invokeAsync(ctx, invokeMap, args); @@ -2312,8 +2416,9 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, IgniteInternalFuture<GridCacheReturn> fut0 = (IgniteInternalFuture<GridCacheReturn>)fut; return fut0.chain(new CX1<IgniteInternalFuture<GridCacheReturn>, Map<K, EntryProcessorResult<T>>>() { - @Override public Map<K, EntryProcessorResult<T>> applyx(IgniteInternalFuture<GridCacheReturn> fut) - throws IgniteCheckedException { + @Override + public Map<K, EntryProcessorResult<T>> applyx(IgniteInternalFuture<GridCacheReturn> fut) + throws IgniteCheckedException { GridCacheReturn ret = fut.get(); assert ret != null; @@ -2344,7 +2449,36 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> putxAsync(final K key, final V val, + @Override public IgniteInternalFuture<Boolean> putxAsync(K key, V val) { + return putxAsync(key, val, null); + } + + /** + * Stores given key-value pair in cache. If filters are provided, then entries will + * be stored in cache only if they pass the filter. Note that filter check is atomic, + * so value stored in cache is guaranteed to be consistent with the filters. + * <p> + * This method will return {@code true} if value is stored in cache and {@code false} otherwise. + * Unlike <code>#put(Object, Object, org.apache.ignite.lang.IgnitePredicate[])</code> method, it does not return previous + * value and, therefore, does not have any overhead associated with returning of a value. It + * should always be used whenever return value is not required. + * <p> + * If write-through is enabled, the stored value will be persisted to {@link org.apache.ignite.cache.store.CacheStore} + * via <code>CacheStore#put(Transaction, Object, Object)</code> method. + * <h2 class="header">Transactions</h2> + * This method is transactional and will enlist the entry into ongoing transaction + * if there is one. + * + * @param key Key to store in cache. + * @param val Value to be associated with the given key. + * @param filter Optional filter to check prior to putting value in cache. Note + * that filter check is atomic with put operation. + * @return Future for the put operation. Future will return {@code true} if optional filter + * passed and value was stored in cache, {@code false} otherwise. Note that future will + * return {@code true} if filter is not specified. + * @throws NullPointerException If either key or value are {@code null}. + */ + public IgniteInternalFuture<Boolean> putxAsync(final K key, final V val, @Nullable final CacheEntryPredicate... filter) { final boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2660,7 +2794,28 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public void putAll(@Nullable final Map<? extends K, ? extends V> m, + @Override public void putAll(@Nullable final Map<? extends K, ? extends V> m) + throws IgniteCheckedException { + putAll(m, null); + } + + /** + * Stores given key-value pairs in cache. If filters are provided, then entries will + * be stored in cache only if they pass the filter. Note that filter check is atomic, + * so value stored in cache is guaranteed to be consistent with the filters. + * <p> + * If write-through is enabled, the stored values will be persisted to {@link org.apache.ignite.cache.store.CacheStore} + * via <code>CacheStore#putAll(Transaction, Map)</code> method. + * <h2 class="header">Transactions</h2> + * This method is transactional and will enlist the entry into ongoing transaction + * if there is one. + * + * @param m Key-value pairs to store in cache. + * @param filter Optional entry filter. If provided, then entry will + * be stored only if the filter returned {@code true}. + * @throws IgniteCheckedException If put operation failed. + */ + public void putAll(@Nullable final Map<? extends K, ? extends V> m, final CacheEntryPredicate[] filter) throws IgniteCheckedException { boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2689,7 +2844,27 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<?> putAllAsync(final Map<? extends K, ? extends V> m, + @Override public IgniteInternalFuture<?> putAllAsync(final Map<? extends K, ? extends V> m) { + return putAllAsync(m, null); + } + + /** + * Asynchronously stores given key-value pairs in cache. If filters are provided, then entries will + * be stored in cache only if they pass the filter. Note that filter check is atomic, + * so value stored in cache is guaranteed to be consistent with the filters. + * <p> + * If write-through is enabled, the stored values will be persisted to {@link org.apache.ignite.cache.store.CacheStore} + * via <code>CacheStore#putAll(Transaction, Map)</code> method. + * <h2 class="header">Transactions</h2> + * This method is transactional and will enlist the entry into ongoing transaction + * if there is one. + * + * @param m Key-value pairs to store in cache. + * @param filter Optional entry filter. If provided, then entry will + * be stored only if the filter returned {@code true}. + * @return Future for putAll operation. + */ + public IgniteInternalFuture<?> putAllAsync(final Map<? extends K, ? extends V> m, @Nullable final CacheEntryPredicate... filter) { if (F.isEmpty(m)) return new GridFinishedFuture<Object>(); @@ -2710,13 +2885,44 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, }); } - /** {@inheritDoc} */ - @Nullable @Override public V remove(K key, CacheEntryPredicate[] filter) + /** + * Removes given key mapping from cache. If cache previously contained value for the given key, + * then this value is returned. In case of {@link CacheMode#PARTITIONED} or {@link CacheMode#REPLICATED} + * caches, the value will be loaded from the primary node, which in its turn may load the value + * from the disk-based swap storage, and consecutively, if it's not in swap, + * from the underlying persistent storage. If value has to be loaded from persistent + * storage, <code>CacheStore#load(Transaction, Object)</code> method will be used. + * <p> + * If the returned value is not needed, method <code>#removex(Object, org.apache.ignite.lang.IgnitePredicate[])</code> should + * always be used instead of this one to avoid the overhead associated with returning of the + * previous value. + * <p> + * If write-through is enabled, the value will be removed from {@link org.apache.ignite.cache.store.CacheStore} + * via <code>CacheStore#remove(Transaction, Object)</code> method. + * <h2 class="header">Transactions</h2> + * This method is transactional and will enlist the entry into ongoing transaction + * if there is one. + * + * @param key Key whose mapping is 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 Previous value associated with specified key, or {@code null} + * if there was no value for this key. + * @throws NullPointerException If key is {@code null}. + * @throws IgniteCheckedException If remove operation failed. + */ + @Nullable public V remove(K key, CacheEntryPredicate[] filter) throws IgniteCheckedException { return remove(key, null, filter); } /** {@inheritDoc} */ + @Nullable @Override public V remove(K key) + throws IgniteCheckedException { + return remove(key, (CacheEntryPredicate[])null); + } + + /** {@inheritDoc} */ @Override public V remove(final K key, @Nullable final GridCacheEntryEx entry, @Nullable final CacheEntryPredicate... filter) throws IgniteCheckedException { boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2749,8 +2955,31 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return prevVal; } - /** {@inheritDoc} */ - @Override public IgniteInternalFuture<V> removeAsync(K key, CacheEntryPredicate... filter) { + /** + * Asynchronously removes given key mapping from cache. If cache previously contained value for the given key, + * then this value is returned. In case of {@link CacheMode#PARTITIONED} or {@link CacheMode#REPLICATED} + * caches, the value will be loaded from the primary node, which in its turn may load the value + * from the swap storage, and consecutively, if it's not in swap, + * from the underlying persistent storage. If value has to be loaded from persistent + * storage, <code>CacheStore#load(Transaction, Object)</code> method will be used. + * <p> + * If the returned value is not needed, method <code>#removex(Object, org.apache.ignite.lang.IgnitePredicate[])</code> should + * always be used instead of this one to avoid the overhead associated with returning of the + * previous value. + * <p> + * If write-through is enabled, the value will be removed from {@link org.apache.ignite.cache.store.CacheStore} + * via <code>CacheStore#remove(Transaction, Object)</code> method. + * <h2 class="header">Transactions</h2> + * This method is transactional and will enlist the entry into ongoing transaction + * if there is one. + * + * @param key Key whose mapping is 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. + * @throws NullPointerException if the key is {@code null}. + */ + public IgniteInternalFuture<V> removeAsync(K key, CacheEntryPredicate... filter) { final boolean statsEnabled = ctx.config().isStatisticsEnabled(); final long start = statsEnabled ? System.nanoTime() : 0L; @@ -2764,6 +2993,11 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ + @Override public IgniteInternalFuture<V> removeAsync(K key) { + return removeAsync(key, (CacheEntryPredicate[]) null); + } + + /** {@inheritDoc} */ @Override public IgniteInternalFuture<V> removeAsync(final K key, @Nullable final GridCacheEntryEx entry, @Nullable final CacheEntryPredicate... filter) { final boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2793,8 +3027,22 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return fut; } - /** {@inheritDoc} */ - @Override public void removeAll(final Collection<? extends K> keys, + /** + * Removes given key mappings from cache for entries for which the optionally passed in filters do + * pass. + * <p> + * If write-through is enabled, the values will be removed from {@link org.apache.ignite.cache.store.CacheStore} + * via <code>@link CacheStore#removeAll(Transaction, Collection)</code> method. + * <h2 class="header">Transactions</h2> + * This method is transactional and will enlist the entry into ongoing transaction + * 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(final Collection<? extends K> keys, final CacheEntryPredicate... filter) throws IgniteCheckedException { boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2823,7 +3071,27 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<?> removeAllAsync(@Nullable final Collection<? extends K> keys, + @Override public void removeAll(final Collection<? extends K> keys) throws IgniteCheckedException { + removeAll(keys, (CacheEntryPredicate[]) null); + } + + /** + * Asynchronously removes given key mappings from cache for entries for which the optionally + * passed in filters do pass. + * <p> + * If write-through is enabled, the values will be removed from {@link org.apache.ignite.cache.store.CacheStore} + * via <code>@link CacheStore#removeAll(Transaction, Collection)</code> method. + * <h2 class="header">Transactions</h2> + * This method is transactional and will enlist the entry into ongoing transaction + * 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 final Collection<? extends K> keys, final CacheEntryPredicate... filter) { final boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2852,7 +3120,31 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public boolean removex(final K key, final CacheEntryPredicate... filter) + @Override public IgniteInternalFuture<?> removeAllAsync(@Nullable final Collection<? extends K> keys) { + return removeAllAsync(keys, null); + } + + /** + * Removes given key mapping from cache. + * <p> + * This method will return {@code true} if remove did occur, which means that all optionally + * provided filters have passed and there was something to remove, {@code false} otherwise. + * <p> + * If write-through is enabled, the value will be removed from {@link org.apache.ignite.cache.store.CacheStore} + * via <code>CacheStore#remove(Transaction, Object)</code> method. + * <h2 class="header">Transactions</h2> + * This method is transactional and will enlist the entry into ongoing transaction + * if there is one. + * + * @param key Key whose mapping is 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 {@code True} if filter passed validation and entry was removed, {@code false} otherwise. + * Note that if filter is not specified, this method will return {@code true}. + * @throws NullPointerException if the key is {@code null}. + * @throws IgniteCheckedException If remove failed. + */ + public boolean removex(final K key, final CacheEntryPredicate... filter) throws IgniteCheckedException { boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2867,6 +3159,12 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ + @Override public boolean removex(final K key) + throws IgniteCheckedException { + return removex(key, (CacheEntryPredicate[]) null); + } + + /** {@inheritDoc} */ @Override public boolean removex(final K key, @Nullable final GridCacheEntryEx entry, @Nullable final CacheEntryPredicate... filter) throws IgniteCheckedException { boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -2894,14 +3192,38 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return rmv; } - /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> removexAsync(K key, CacheEntryPredicate... filter) { + /** + * Asynchronously removes given key mapping from cache. + * <p> + * This method will return {@code true} if remove did occur, which means that all optionally + * provided filters have passed and there was something to remove, {@code false} otherwise. + * <p> + * If write-through is enabled, the value will be removed from {@link org.apache.ignite.cache.store.CacheStore} + * via <code>CacheStore#remove(Transaction, Object)</code> method. + * <h2 class="header">Transactions</h2> + * This method is transactional and will enlist the entry into ongoing transaction + * if there is one. + * + * @param key Key whose mapping is 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 return {@code true} + * if optional filters passed validation and remove did occur, {@code false} otherwise. + * Note that if filter is not specified, this method will return {@code true}. + * @throws NullPointerException if the key is {@code null}. + */ + public IgniteInternalFuture<Boolean> removexAsync(K key, CacheEntryPredicate... filter) { A.notNull(key, "key"); return removexAsync(key, null, filter); } /** {@inheritDoc} */ + @Override public IgniteInternalFuture<Boolean> removexAsync(K key) { + return removexAsync(key, (CacheEntryPredicate[])null); + } + + /** {@inheritDoc} */ @Override public IgniteInternalFuture<Boolean> removexAsync(final K key, @Nullable final GridCacheEntryEx entry, @Nullable final CacheEntryPredicate... filter) { final boolean statsEnabled = ctx.config().isStatisticsEnabled(); @@ -4510,7 +4832,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, * @param filter Filters to evaluate. * @return Key set. */ - @Override public Set<K> keySet(@Nullable CacheEntryPredicate... filter) { + public Set<K> keySet(@Nullable CacheEntryPredicate... filter) { return map.keySet(filter); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6ecc1164/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 5cc2aa7..9d92542 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 @@ -348,23 +348,21 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public V put(K key, V val, @Nullable CacheEntryPredicate[] filter) + @Override public V put(K key, V val) throws IgniteCheckedException { - return putAsync(key, val, filter).get(); + return putAsync(key, val).get(); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<V> putAsync(K key, V val, - @Nullable CacheEntryPredicate[] filter) { + @Override public IgniteInternalFuture<V> putAsync(K key, V val) { A.notNull(key, "key", val, "val"); - return cache.putAsync(key, val, filter); + return cache.putAsync(key, val); } /** {@inheritDoc} */ - @Override public boolean putx(K key, V val, - @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { - return putxAsync(key, val, filter).get(); + @Override public boolean putx(K key, V val) throws IgniteCheckedException { + return cache.putxAsync(key, val).get(); } /** {@inheritDoc} */ @@ -420,11 +418,10 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> putxAsync(K key, V val, - @Nullable CacheEntryPredicate[] filter) { + @Override public IgniteInternalFuture<Boolean> putxAsync(K key, V val) { A.notNull(key, "key", val, "val"); - return cache.putxAsync(key, val, filter); + return cache.putxAsync(key, val, null); } /** {@inheritDoc} */ @@ -434,7 +431,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V /** {@inheritDoc} */ @Override public IgniteInternalFuture<V> putIfAbsentAsync(K key, V val) { - return putAsync(key, val, cctx.noValArray()); + return cache.putAsync(key, val, cctx.noValArray()); } /** {@inheritDoc} */ @@ -444,7 +441,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V /** {@inheritDoc} */ @Override public IgniteInternalFuture<Boolean> putxIfAbsentAsync(K key, V val) { - return putxAsync(key, val, cctx.noValArray()); + return cache.putxAsync(key, val, cctx.noValArray()); } /** {@inheritDoc} */ @@ -454,7 +451,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V /** {@inheritDoc} */ @Override public IgniteInternalFuture<V> replaceAsync(K key, V val) { - return putAsync(key, val, cctx.hasValArray()); + return cache.putAsync(key, val, cctx.hasValArray()); } /** {@inheritDoc} */ @@ -464,7 +461,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V /** {@inheritDoc} */ @Override public IgniteInternalFuture<Boolean> replacexAsync(K key, V val) { - return putxAsync(key, val, cctx.hasValArray()); + return cache.putxAsync(key, val, cctx.hasValArray()); } /** {@inheritDoc} */ @@ -480,15 +477,13 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public void putAll(Map<? extends K, ? extends V> m, - @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { - putAllAsync(m, filter).get(); + @Override public void putAll(Map<? extends K, ? extends V> m) throws IgniteCheckedException { + putAllAsync(m).get(); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<?> putAllAsync(Map<? extends K, ? extends V> m, - @Nullable CacheEntryPredicate[] filter) { - return cache.putAllAsync(m, filter); + @Override public IgniteInternalFuture<?> putAllAsync(Map<? extends K, ? extends V> m) { + return cache.putAllAsync(m); } /** {@inheritDoc} */ @@ -497,11 +492,6 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public Set<K> keySet(@Nullable CacheEntryPredicate... filter) { - return cache.keySet(filter); - } - - /** {@inheritDoc} */ @Override public Set<K> primaryKeySet() { return cache.primaryKeySet(); } @@ -642,9 +632,8 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public V remove(K key, - @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { - return removeAsync(key, filter).get(); + @Override public V remove(K key) throws IgniteCheckedException { + return removeAsync(key).get(); } /** {@inheritDoc} */ @@ -654,8 +643,8 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<V> removeAsync(K key, CacheEntryPredicate[] filter) { - return removeAsync(key, null, filter); + @Override public IgniteInternalFuture<V> removeAsync(K key) { + return removeAsync(key, null, null); } /** {@inheritDoc} */ @@ -665,9 +654,8 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public boolean removex(K key, - @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { - return removexAsync(key, filter).get(); + @Override public boolean removex(K key) throws IgniteCheckedException { + return removexAsync(key).get(); } /** {@inheritDoc} */ @@ -688,9 +676,8 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> removexAsync(K key, - @Nullable CacheEntryPredicate[] filter) { - return removexAsync(key, null, filter); + @Override public IgniteInternalFuture<Boolean> removexAsync(K key) { + return cache.removexAsync(key, null, null); } /** {@inheritDoc} */ @@ -732,15 +719,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, null); } /** {@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, null); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6ecc1164/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 13fce09..bead378 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 @@ -578,12 +578,12 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Nullable @Override public V put(K key, V val, @Nullable CacheEntryPredicate[] filter) + @Nullable @Override public V put(K key, V val) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.put(key, val, filter); + return delegate.put(key, val); } finally { gate.leave(prev); @@ -591,12 +591,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<V> putAsync(K key, V val, - @Nullable CacheEntryPredicate[] filter) { + @Override public IgniteInternalFuture<V> putAsync(K key, V val) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.putAsync(key, val, filter); + return delegate.putAsync(key, val); } finally { gate.leave(prev); @@ -604,12 +603,12 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public boolean putx(K key, V val, @Nullable CacheEntryPredicate[] filter) + @Override public boolean putx(K key, V val) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.putx(key, val, filter); + return delegate.putx(key, val); } finally { gate.leave(prev); @@ -727,12 +726,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> putxAsync(K key, V val, - @Nullable CacheEntryPredicate[] filter) { + @Override public IgniteInternalFuture<Boolean> putxAsync(K key, V val) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.putxAsync(key, val, filter); + return delegate.putxAsync(key, val); } finally { gate.leave(prev); @@ -860,12 +858,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public void putAll(@Nullable Map<? extends K, ? extends V> m, - @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { + @Override public void putAll(@Nullable Map<? extends K, ? extends V> m) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - delegate.putAll(m, filter); + delegate.putAll(m); } finally { gate.leave(prev); @@ -873,12 +870,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<?> putAllAsync(@Nullable Map<? extends K, ? extends V> m, - @Nullable CacheEntryPredicate[] filter) { + @Override public IgniteInternalFuture<?> putAllAsync(@Nullable Map<? extends K, ? extends V> m) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.putAllAsync(m, filter); + return delegate.putAllAsync(m); } finally { gate.leave(prev); @@ -898,18 +894,6 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public Set<K> keySet(@Nullable CacheEntryPredicate... filter) { - GridCacheProjectionImpl<K, V> prev = gate.enter(prj); - - try { - return delegate.keySet(filter); - } - finally { - gate.leave(prev); - } - } - - /** {@inheritDoc} */ @Override public Set<K> primaryKeySet() { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); @@ -1264,12 +1248,12 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Nullable @Override public V remove(K key, @Nullable CacheEntryPredicate[] filter) + @Nullable @Override public V remove(K key) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.remove(key, filter); + return delegate.remove(key); } finally { gate.leave(prev); @@ -1290,11 +1274,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<V> removeAsync(K key, CacheEntryPredicate[] filter) { + @Override public IgniteInternalFuture<V> removeAsync(K key) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.removeAsync(key, filter); + return delegate.removeAsync(key); } finally { gate.leave(prev); @@ -1315,12 +1299,12 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public boolean removex(K key, @Nullable CacheEntryPredicate[] filter) + @Override public boolean removex(K key) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.removex(key, filter); + return delegate.removex(key); } finally { gate.leave(prev); @@ -1368,12 +1352,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> removexAsync(K key, - @Nullable CacheEntryPredicate[] filter) { + @Override public IgniteInternalFuture<Boolean> removexAsync(K key) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.removexAsync(key, filter); + return delegate.removexAsync(key); } finally { gate.leave(prev); @@ -1466,12 +1449,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); @@ -1479,12 +1461,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);