#ignite-683: Remove method evict(K key, CacheEntryPredicate[] filter) and evictAll(Collection<? extends K> keys, CacheEntryPredicate[] filter) from GridCacheAdapter.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8113edd0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8113edd0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8113edd0 Branch: refs/heads/ignite-683-2 Commit: 8113edd05bbc2a84df64c31ef7b038c4106f6a32 Parents: db252df Author: ivasilinets <[email protected]> Authored: Mon Apr 13 14:04:44 2015 +0300 Committer: ivasilinets <[email protected]> Committed: Mon Apr 13 14:04:44 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/GridCacheAdapter.java | 43 ++++++-------------- .../distributed/near/GridNearCacheAdapter.java | 11 +++-- 2 files changed, 18 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8113edd0/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 c0f6a62..c2ea41a 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 @@ -924,7 +924,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} */ @@ -939,17 +939,17 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** {@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); } /** @@ -1271,7 +1271,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); } }); @@ -1478,16 +1479,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public boolean evict(K key) { - return evict(key, (CacheEntryPredicate[])null); - } - - /** {@inheritDoc} */ - @Override public void evictAll(Collection<? extends K> keys) { - evictAll(keys, (CacheEntryPredicate[])null); - } - - /** {@inheritDoc} */ @Nullable @Override public V get(K key) throws IgniteCheckedException { A.notNull(key, "key"); @@ -4376,26 +4367,18 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return clearLocally(ctx.versions().next(), key, filter); } - /** - * @param key Key. - * @param filter Filters to evaluate. - * @return {@code True} if evicted. - */ - public boolean evict(K key, @Nullable CacheEntryPredicate... filter) { + /** {@inheritDoc} */ + @Override public boolean evict(K key) { A.notNull(key, "key"); if (keyCheck) validateCacheKey(key); - return evictx(key, ctx.versions().next(), filter); + return evictx(key, ctx.versions().next(), CU.empty0()); } - /** - * @param keys Keys. - * @param filter Filters to evaluate. - */ - public void evictAll(Collection<? extends K> keys, - @Nullable CacheEntryPredicate... filter) { + /** {@inheritDoc} */ + @Override public void evictAll(Collection<? extends K> keys) { A.notNull(keys, "keys"); if (F.isEmpty(keys)) @@ -4406,7 +4389,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, GridCacheVersion obsoleteVer = ctx.versions().next(); - if (!ctx.evicts().evictSyncOrNearSync() && F.isEmptyOrNulls(filter) && ctx.isSwapOrOffheapEnabled()) { + if (!ctx.evicts().evictSyncOrNearSync() && ctx.isSwapOrOffheapEnabled()) { try { ctx.evicts().batchEvict(keys, obsoleteVer); } @@ -4416,7 +4399,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } else { for (K k : keys) - evictx(k, obsoleteVer, filter); + evictx(k, obsoleteVer, CU.empty0()); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8113edd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java index 50f4fa7..f153bd6 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java @@ -387,17 +387,16 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda } /** {@inheritDoc} */ - @Override public boolean evict(K key, @Nullable CacheEntryPredicate[] filter) { + @Override public boolean evict(K key) { // Use unary 'and' to make sure that both sides execute. - return super.evict(key, filter) & dht().evict(key, filter); + return super.evict(key) & dht().evict(key); } /** {@inheritDoc} */ - @Override public void evictAll(Collection<? extends K> keys, - @Nullable CacheEntryPredicate[] filter) { - super.evictAll(keys, filter); + @Override public void evictAll(Collection<? extends K> keys) { + super.evictAll(keys); - dht().evictAll(keys, filter); + dht().evictAll(keys); } /** {@inheritDoc} */
