#ignite-683: Remove filter from GridCacheProjection.lock.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8b4b5624 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8b4b5624 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8b4b5624 Branch: refs/heads/ignite-683 Commit: 8b4b5624567355215bc298a01d8d7e9413233b1d Parents: 23b52a6 Author: ivasilinets <ivasilin...@gridgain.com> Authored: Tue Apr 7 00:45:08 2015 +0300 Committer: ivasilinets <ivasilin...@gridgain.com> Committed: Tue Apr 7 00:45:08 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/CacheProjection.java | 25 ++++---------- .../processors/cache/GridCacheAdapter.java | 22 ++++++------- .../cache/GridCacheProjectionImpl.java | 29 +++++++---------- .../processors/cache/GridCacheProxyImpl.java | 28 +++++++--------- .../GridDistributedCacheAdapter.java | 15 +++------ .../distributed/dht/GridDhtCacheAdapter.java | 3 +- .../dht/GridDhtTransactionalCacheAdapter.java | 13 +++----- .../distributed/dht/GridDhtTxLocalAdapter.java | 3 +- .../dht/atomic/GridDhtAtomicCache.java | 3 +- .../dht/colocated/GridDhtColocatedCache.java | 10 +++--- .../distributed/near/GridNearAtomicCache.java | 10 +++--- .../near/GridNearTransactionalCache.java | 10 +++--- .../cache/distributed/near/GridNearTxLocal.java | 3 +- .../processors/cache/local/GridLocalCache.java | 34 +++++--------------- .../local/atomic/GridLocalAtomicCache.java | 9 ++---- .../transactions/IgniteTxLocalAdapter.java | 12 +++---- 16 files changed, 79 insertions(+), 150 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/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 2ef345d..3897125 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 @@ -1381,12 +1381,11 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * @param timeout Timeout in milliseconds to wait for lock to be acquired * ({@code '0'} for no expiration), {@code -1} for immediate failure if * lock cannot be acquired immediately). - * @param filter Optional filter to validate prior to acquiring the lock. * @return {@code True} if all filters passed and lock was acquired, * {@code false} otherwise. * @throws IgniteCheckedException If lock acquisition resulted in error. */ - public boolean lock(K key, long timeout, @Nullable CacheEntryPredicate... filter) + public boolean lock(K key, long timeout) throws IgniteCheckedException; /** @@ -1403,13 +1402,11 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * @param timeout Timeout in milliseconds to wait for lock to be acquired * ({@code '0'} for no expiration, {@code -1} for immediate failure if * lock cannot be acquired immediately). - * @param filter Optional filter to validate prior to acquiring the lock. * @return Future for the lock operation. The future will return {@code true} * whenever all filters pass and locks are acquired before timeout is expired, * {@code false} otherwise. */ - public IgniteInternalFuture<Boolean> lockAsync(K key, long timeout, - @Nullable CacheEntryPredicate... filter); + public IgniteInternalFuture<Boolean> lockAsync(K key, long timeout); /** * All or nothing synchronous lock for passed in keys. This method @@ -1424,14 +1421,11 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * @param keys Keys to lock. * @param timeout Timeout in milliseconds to wait for lock to be acquired * ({@code '0'} for no expiration). - * @param filter Optional filter that needs to atomically pass in order for the locks - * to be acquired. * @return {@code True} if all filters passed and locks were acquired before * timeout has expired, {@code false} otherwise. * @throws IgniteCheckedException If lock acquisition resulted in error. */ - public boolean lockAll(@Nullable Collection<? extends K> keys, long timeout, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException; + public boolean lockAll(@Nullable Collection<? extends K> keys, long timeout) throws IgniteCheckedException; /** * All or nothing synchronous lock for passed in keys. This method @@ -1446,14 +1440,11 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * @param keys Keys to lock. * @param timeout Timeout in milliseconds to wait for lock to be acquired * ({@code '0'} for no expiration). - * @param filter Optional filter that needs to atomically pass in order for the locks - * to be acquired. * @return Future for the collection of locks. The future will return * {@code true} if all filters passed and locks were acquired before * timeout has expired, {@code false} otherwise. */ - public IgniteInternalFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, long timeout, - @Nullable CacheEntryPredicate... filter); + public IgniteInternalFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, long timeout); /** * Unlocks given key only if current thread owns the lock. If optional filter @@ -1466,10 +1457,9 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * which will acquire explicit locks for relevant cache operations. * * @param key Key to unlock. - * @param filter Optional filter that needs to pass prior to unlock taking effect. * @throws IgniteCheckedException If unlock execution resulted in error. */ - public void unlock(K key, CacheEntryPredicate... filter) throws IgniteCheckedException; + public void unlock(K key) throws IgniteCheckedException; /** * Unlocks given keys only if current thread owns the locks. Only the keys @@ -1483,12 +1473,9 @@ public interface CacheProjection<K, V> extends Iterable<Cache.Entry<K, V>> { * which will acquire explicit locks for relevant cache operations. * * @param keys Keys to unlock. - * @param filter Optional filter which needs to pass for individual entries - * to be unlocked. * @throws IgniteCheckedException If unlock execution resulted in error. */ - public void unlockAll(@Nullable Collection<? extends K> keys, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException; + public void unlockAll(@Nullable Collection<? extends K> keys) throws IgniteCheckedException; /** * Checks if any node owns a lock for this key. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/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 015313a..38c8c28 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 @@ -472,8 +472,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, boolean retval, TransactionIsolation isolation, boolean invalidate, - long accessTtl, - CacheEntryPredicate[] filter); + long accessTtl); /** * Post constructor initialization for subclasses. @@ -3256,23 +3255,21 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public boolean lock(K key, long timeout, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { + @Override public boolean lock(K key, long timeout) throws IgniteCheckedException { A.notNull(key, "key"); - return lockAll(Collections.singletonList(key), timeout, filter); + return lockAll(Collections.singletonList(key), timeout); } /** {@inheritDoc} */ - @Override public boolean lockAll(@Nullable Collection<? extends K> keys, long timeout, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { + @Override public boolean lockAll(@Nullable Collection<? extends K> keys, long timeout) throws IgniteCheckedException { if (F.isEmpty(keys)) return true; if (keyCheck) validateCacheKeys(keys); - IgniteInternalFuture<Boolean> fut = lockAllAsync(keys, timeout, filter); + IgniteInternalFuture<Boolean> fut = lockAllAsync(keys, timeout); boolean isInterrupted = false; @@ -3294,25 +3291,24 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> lockAsync(K key, long timeout, - @Nullable CacheEntryPredicate... filter) { + @Override public IgniteInternalFuture<Boolean> lockAsync(K key, long timeout) { A.notNull(key, "key"); if (keyCheck) validateCacheKey(key); - return lockAllAsync(Collections.singletonList(key), timeout, filter); + return lockAllAsync(Collections.singletonList(key), timeout); } /** {@inheritDoc} */ - @Override public void unlock(K key, CacheEntryPredicate... filter) + @Override public void unlock(K key) throws IgniteCheckedException { A.notNull(key, "key"); if (keyCheck) validateCacheKey(key); - unlockAll(Collections.singletonList(key), filter); + unlockAll(Collections.singletonList(key)); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/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 42feced..4c5cb59 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 @@ -783,38 +783,33 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public boolean lock(K key, long timeout, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { - return cache.lock(key, timeout, filter); + @Override public boolean lock(K key, long timeout) throws IgniteCheckedException { + return cache.lock(key, timeout); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> lockAsync(K key, long timeout, - @Nullable CacheEntryPredicate[] filter) { - return cache.lockAsync(key, timeout, filter); + @Override public IgniteInternalFuture<Boolean> lockAsync(K key, long timeout) { + return cache.lockAsync(key, timeout); } /** {@inheritDoc} */ - @Override public boolean lockAll(@Nullable Collection<? extends K> keys, long timeout, - @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { - return cache.lockAll(keys, timeout, filter); + @Override public boolean lockAll(@Nullable Collection<? extends K> keys, long timeout) throws IgniteCheckedException { + return cache.lockAll(keys, timeout); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, long timeout, - @Nullable CacheEntryPredicate[] filter) { - return cache.lockAllAsync(keys, timeout, filter); + @Override public IgniteInternalFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, long timeout) { + return cache.lockAllAsync(keys, timeout); } /** {@inheritDoc} */ - @Override public void unlock(K key, CacheEntryPredicate[] filter) throws IgniteCheckedException { - cache.unlock(key, filter); + @Override public void unlock(K key) throws IgniteCheckedException { + cache.unlock(key); } /** {@inheritDoc} */ - @Override public void unlockAll(@Nullable Collection<? extends K> keys, - @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { - cache.unlockAll(keys, filter); + @Override public void unlockAll(@Nullable Collection<? extends K> keys) throws IgniteCheckedException { + cache.unlockAll(keys); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/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 f33d4e0..b25f914 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 @@ -1583,12 +1583,12 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public boolean lock(K key, long timeout, @Nullable CacheEntryPredicate[] filter) + @Override public boolean lock(K key, long timeout) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.lock(key, timeout, filter); + return delegate.lock(key, timeout); } finally { gate.leave(prev); @@ -1596,12 +1596,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> lockAsync(K key, long timeout, - @Nullable CacheEntryPredicate[] filter) { + @Override public IgniteInternalFuture<Boolean> lockAsync(K key, long timeout) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.lockAsync(key, timeout, filter); + return delegate.lockAsync(key, timeout); } finally { gate.leave(prev); @@ -1609,12 +1608,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public boolean lockAll(@Nullable Collection<? extends K> keys, long timeout, - @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { + @Override public boolean lockAll(@Nullable Collection<? extends K> keys, long timeout) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.lockAll(keys, timeout, filter); + return delegate.lockAll(keys, timeout); } finally { gate.leave(prev); @@ -1622,12 +1620,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, long timeout, - @Nullable CacheEntryPredicate[] filter) { + @Override public IgniteInternalFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, long timeout) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.lockAllAsync(keys, timeout, filter); + return delegate.lockAllAsync(keys, timeout); } finally { gate.leave(prev); @@ -1635,11 +1632,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public void unlock(K key, CacheEntryPredicate[] filter) throws IgniteCheckedException { + @Override public void unlock(K key) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - delegate.unlock(key, filter); + delegate.unlock(key); } finally { gate.leave(prev); @@ -1647,12 +1644,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public void unlockAll(@Nullable Collection<? extends K> keys, - @Nullable CacheEntryPredicate[] filter) throws IgniteCheckedException { + @Override public void unlockAll(@Nullable Collection<? extends K> keys) throws IgniteCheckedException { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - delegate.unlockAll(keys, filter); + delegate.unlockAll(keys); } finally { gate.leave(prev); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java index b78e7e0..13558da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java @@ -81,17 +81,15 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter boolean retval, TransactionIsolation isolation, boolean isInvalidate, - long accessTtl, - CacheEntryPredicate[] filter + long accessTtl ) { assert tx != null; - return lockAllAsync(keys, timeout, tx, isInvalidate, isRead, retval, isolation, accessTtl, filter); + return lockAllAsync(keys, timeout, tx, isInvalidate, isRead, retval, isolation, accessTtl); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> lockAllAsync(Collection<? extends K> keys, long timeout, - CacheEntryPredicate... filter) { + @Override public IgniteInternalFuture<Boolean> lockAllAsync(Collection<? extends K> keys, long timeout) { IgniteTxLocalEx tx = ctx.tm().userTxx(); // Return value flag is true because we choose to bring values for explicit locks. @@ -102,8 +100,7 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter false, /*retval*/true, null, - -1L, - filter); + -1L); } /** @@ -115,7 +112,6 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter * @param retval Flag to return value. * @param isolation Transaction isolation. * @param accessTtl TTL for read operation. - * @param filter Optional filter. * @return Future for locks. */ protected abstract IgniteInternalFuture<Boolean> lockAllAsync(Collection<KeyCacheObject> keys, @@ -125,8 +121,7 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter boolean isRead, boolean retval, @Nullable TransactionIsolation isolation, - long accessTtl, - CacheEntryPredicate[] filter); + long accessTtl); /** * @param key Key to remove. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java index e19b971..99c7ddd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java @@ -802,8 +802,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap } /** {@inheritDoc} */ - @Override public void unlockAll(Collection<? extends K> keys, - CacheEntryPredicate[] filter) { + @Override public void unlockAll(Collection<? extends K> keys) { assert false; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java index 017b363..af6b42d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java @@ -559,8 +559,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach boolean isRead, boolean retval, TransactionIsolation isolation, - long accessTtl, - CacheEntryPredicate[] filter) { + long accessTtl) { return lockAllAsyncInternal( keys, timeout, @@ -569,8 +568,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach isRead, retval, isolation, - accessTtl, - filter); + accessTtl); } /** @@ -584,7 +582,6 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach * @param retval Return value flag. * @param isolation Transaction isolation. * @param accessTtl TTL for read operation. - * @param filter Optional filter. * @return Lock future. */ public GridDhtFuture<Boolean> lockAllAsyncInternal(@Nullable Collection<KeyCacheObject> keys, @@ -594,8 +591,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach boolean isRead, boolean retval, TransactionIsolation isolation, - long accessTtl, - CacheEntryPredicate[] filter) { + long accessTtl) { if (keys == null || keys.isEmpty()) return new GridDhtFinishedFuture<>(true); @@ -614,8 +610,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach timeout, tx, tx.threadId(), - accessTtl, - filter); + accessTtl, null); for (KeyCacheObject key : keys) { try { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java index 5e37d96..e1364b0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java @@ -634,8 +634,7 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter { read, needRetVal, isolation, - accessTtl, - CU.empty0()); + accessTtl); return new GridEmbeddedFuture<>( fut, http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/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 52dd71f..3b68223 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 @@ -636,8 +636,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> { boolean isRead, boolean retval, @Nullable TransactionIsolation isolation, - long accessTtl, - CacheEntryPredicate[] filter) { + long accessTtl) { return new FinishedLockFuture(new UnsupportedOperationException("Locks are not supported for " + "CacheAtomicityMode.ATOMIC mode (use CacheAtomicityMode.TRANSACTIONAL instead)")); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java index 0de4653..c0edf02 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java @@ -357,8 +357,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte boolean isRead, boolean retval, @Nullable TransactionIsolation isolation, - long accessTtl, - CacheEntryPredicate[] filter + long accessTtl ) { assert tx == null || tx instanceof GridNearTxLocal; @@ -371,7 +370,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte retval, timeout, accessTtl, - filter); + null); // Future will be added to mvcc only if it was mapped to remote nodes. fut.map(); @@ -397,8 +396,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte } /** {@inheritDoc} */ - @Override public void unlockAll(Collection<? extends K> keys, - CacheEntryPredicate[] filter) { + @Override public void unlockAll(Collection<? extends K> keys) { if (keys.isEmpty()) return; @@ -416,7 +414,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte GridDistributedCacheEntry entry = peekExx(cacheKey); - if (!ctx.isAll(entry, filter)) + if (entry == null) break; // While. GridCacheMvccCandidate lock = http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/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 f3b7eb7..ab661ca 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 @@ -659,15 +659,13 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> { boolean isRead, boolean retval, @Nullable TransactionIsolation isolation, - long accessTtl, - CacheEntryPredicate[] filter) { - return dht.lockAllAsync(null, timeout, filter); + long accessTtl) { + return dht.lockAllAsync(null, timeout); } /** {@inheritDoc} */ - @Override public void unlockAll(@Nullable Collection<? extends K> keys, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { - dht.unlockAll(keys, filter); + @Override public void unlockAll(@Nullable Collection<? extends K> keys) throws IgniteCheckedException { + dht.unlockAll(keys); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java index 44ff756..8297c05 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java @@ -413,8 +413,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V> boolean isRead, boolean retval, TransactionIsolation isolation, - long accessTtl, - CacheEntryPredicate[] filter + long accessTtl ) { GridNearLockFuture<K, V> fut = new GridNearLockFuture<>(ctx, keys, @@ -422,8 +421,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V> isRead, retval, timeout, - accessTtl, - filter); + accessTtl, null); if (!ctx.mvcc().addFuture(fut)) throw new IllegalStateException("Duplicate future ID: " + fut); @@ -465,7 +463,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V> } /** {@inheritDoc} */ - @Override public void unlockAll(Collection<? extends K> keys, CacheEntryPredicate[] filter) { + @Override public void unlockAll(Collection<? extends K> keys) { if (keys.isEmpty()) return; @@ -484,7 +482,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V> GridDistributedCacheEntry entry = peekExx(cacheKey); - if (entry == null || !ctx.isAll(entry, filter)) + if (entry == null) break; // While. try { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java index fa916b0..e65532e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java @@ -1089,8 +1089,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter { read, /*retval*/false, isolation, - accessTtl, - CU.empty0()); + accessTtl); return new GridEmbeddedFuture<>( fut, http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java index 5780144..59e6070 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCache.java @@ -110,36 +110,31 @@ public class GridLocalCache<K, V> extends GridCacheAdapter<K, V> { boolean retval, TransactionIsolation isolation, boolean invalidate, - long accessTtl, - CacheEntryPredicate[] filter) { - return lockAllAsync(keys, timeout, tx, filter); + long accessTtl) { + return lockAllAsync(keys, timeout, tx); } /** {@inheritDoc} */ - @Override public IgniteInternalFuture<Boolean> lockAllAsync(Collection<? extends K> keys, long timeout, - CacheEntryPredicate[] filter) { + @Override public IgniteInternalFuture<Boolean> lockAllAsync(Collection<? extends K> keys, long timeout) { IgniteTxLocalEx tx = ctx.tm().localTx(); - return lockAllAsync(ctx.cacheKeysView(keys), timeout, tx, filter); + return lockAllAsync(ctx.cacheKeysView(keys), timeout, tx); } /** * @param keys Keys. * @param timeout Timeout. * @param tx Transaction. - * @param filter Filter. * @return Future. */ public IgniteInternalFuture<Boolean> lockAllAsync(Collection<KeyCacheObject> keys, long timeout, - @Nullable IgniteTxLocalEx tx, - CacheEntryPredicate[] filter) { + @Nullable IgniteTxLocalEx tx) { if (F.isEmpty(keys)) return new GridFinishedFuture<>(true); - GridLocalLockFuture<K, V> fut = new GridLocalLockFuture<>(ctx, keys, tx, this, timeout, filter); + GridLocalLockFuture<K, V> fut = new GridLocalLockFuture<>(ctx, keys, tx, this, timeout, null); - try { for (KeyCacheObject key : keys) { while (true) { GridLocalCacheEntry entry = null; @@ -147,12 +142,6 @@ public class GridLocalCache<K, V> extends GridCacheAdapter<K, V> { try { entry = entryExx(key); - if (!ctx.isAll(entry, filter)) { - fut.onFailed(); - - return fut; - } - // Removed exception may be thrown here. GridCacheMvccCandidate cand = fut.addEntry(entry); @@ -175,25 +164,18 @@ public class GridLocalCache<K, V> extends GridCacheAdapter<K, V> { fut.checkLocks(); return fut; - } - catch (IgniteCheckedException e) { - fut.onError(e); - - return fut; - } } /** {@inheritDoc} */ @Override public void unlockAll( - Collection<? extends K> keys, - CacheEntryPredicate[] filter + Collection<? extends K> keys ) throws IgniteCheckedException { AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); for (K key : keys) { GridLocalCacheEntry entry = peekExx(ctx.toCacheKeyObject(key)); - if (entry != null && ctx.isAll(entry, filter)) { + if (entry != null) { entry.releaseLocal(); ctx.evicts().touch(entry, topVer); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/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 525dc42..5fb93d6 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 @@ -1458,8 +1458,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> { boolean retval, TransactionIsolation isolation, boolean invalidate, - long accessTtl, - CacheEntryPredicate[] filter) { + long accessTtl) { return new GridFinishedFuture<>(new UnsupportedOperationException("Locks are not supported for " + "CacheAtomicityMode.ATOMIC mode (use CacheAtomicityMode.TRANSACTIONAL instead)")); } @@ -1467,16 +1466,14 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> { /** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public IgniteInternalFuture<Boolean> lockAllAsync(@Nullable Collection<? extends K> keys, - long timeout, - @Nullable CacheEntryPredicate... filter) { + long timeout) { return new GridFinishedFuture<>(new UnsupportedOperationException("Locks are not supported for " + "CacheAtomicityMode.ATOMIC mode (use CacheAtomicityMode.TRANSACTIONAL instead)")); } /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override public void unlockAll(@Nullable Collection<? extends K> keys, - @Nullable CacheEntryPredicate... filter) throws IgniteCheckedException { + @Override public void unlockAll(@Nullable Collection<? extends K> keys) throws IgniteCheckedException { throw new UnsupportedOperationException("Locks are not supported for " + "CacheAtomicityMode.ATOMIC mode (use CacheAtomicityMode.TRANSACTIONAL instead)"); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b4b5624/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java index ab026c8..8bb5f5f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java @@ -1646,8 +1646,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter true, isolation, isInvalidate(), - accessTtl, - CU.empty0()); + accessTtl); PLC2<Map<K, V>> plc2 = new PLC2<Map<K, V>>() { @Override public IgniteInternalFuture<Map<K, V>> postLock() throws IgniteCheckedException { @@ -2618,8 +2617,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter retval, isolation, isInvalidate(), - -1L, - CU.empty0()); + -1L); PLC1<GridCacheReturn> plc1 = new PLC1<GridCacheReturn>(ret) { @Override public GridCacheReturn postLock(GridCacheReturn ret) @@ -2838,8 +2836,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter retval, isolation, isInvalidate(), - -1L, - CU.empty0()); + -1L); PLC1<GridCacheReturn> plc1 = new PLC1<GridCacheReturn>(ret) { @Override protected GridCacheReturn postLock(GridCacheReturn ret) @@ -3023,8 +3020,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter false, isolation, isInvalidate(), - -1L, - CU.empty0()) : + -1L) : new GridFinishedFuture<>(); } catch (IgniteCheckedException e) {