IGNITE-52 - Added skipVals flag.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f14e1aa4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f14e1aa4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f14e1aa4 Branch: refs/heads/ignite-52 Commit: f14e1aa40973423c26e3f77ba18291a634de57b6 Parents: a03fee3 Author: Alexey Goncharuk <agoncha...@gridgain.com> Authored: Tue Jan 27 13:06:10 2015 -0800 Committer: Alexey Goncharuk <agoncha...@gridgain.com> Committed: Tue Jan 27 13:06:10 2015 -0800 ---------------------------------------------------------------------- .../apache/ignite/cache/CacheProjection.java | 14 +- .../processors/cache/GridCacheAdapter.java | 242 ++++++------------- .../cache/GridCacheProjectionImpl.java | 13 +- .../processors/cache/GridCacheProxyImpl.java | 12 + .../processors/cache/GridCacheUtils.java | 12 + .../distributed/dht/GridDhtCacheAdapter.java | 23 +- .../cache/distributed/dht/GridDhtGetFuture.java | 22 +- .../dht/GridPartitionedGetFuture.java | 14 +- .../dht/atomic/GridDhtAtomicCache.java | 13 +- .../dht/colocated/GridDhtColocatedCache.java | 40 +-- .../distributed/near/GridNearAtomicCache.java | 6 +- .../distributed/near/GridNearCacheAdapter.java | 29 ++- .../distributed/near/GridNearCacheEntry.java | 3 +- .../distributed/near/GridNearGetFuture.java | 14 +- .../distributed/near/GridNearGetRequest.java | 30 ++- .../near/GridNearTransactionalCache.java | 14 +- .../cache/distributed/near/GridNearTxLocal.java | 24 +- .../local/atomic/GridLocalAtomicCache.java | 18 +- .../transactions/IgniteTxLocalAdapter.java | 33 ++- .../cache/transactions/IgniteTxLocalEx.java | 5 +- .../GridCachePreloadingEvictionsSelfTest.java | 2 +- .../GridCacheQueryInternalKeysSelfTest.java | 2 +- 22 files changed, 298 insertions(+), 287 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/modules/core/src/main/java/org/apache/ignite/cache/CacheProjection.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheProjection.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheProjection.java index 4d61d1d..37007ae 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/CacheProjection.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheProjection.java @@ -334,12 +334,8 @@ public interface CacheProjection<K, V> extends Iterable<CacheEntry<K, V>> { public ConcurrentMap<K, V> toMap(); /** - * Returns {@code true} if this cache contains a mapping for the specified - * key. - * - * @param key key whose presence in this map is to be tested. - * @return {@code true} if this map contains a mapping for the specified key. - * @throws NullPointerException if the key is {@code null}. + * @param key Key. + * @return {@code True} if cache contains mapping for a given key. */ public boolean containsKey(K key); @@ -350,6 +346,12 @@ public interface CacheProjection<K, V> extends Iterable<CacheEntry<K, V>> { public IgniteFuture<Boolean> containsKeyAsync(K key); /** + * @param keys Keys to check. + * @return Future. + */ + public IgniteFuture<Map<K, Boolean>> containsKeysAsync(Collection<? extends K> keys); + + /** * Returns {@code true} if this cache contains given value. * * @param val Value to check. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/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 6448234..4ccafd4 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 @@ -633,27 +633,34 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public boolean containsKey(K key) { - return containsKey(key, null); + @Override public boolean containsValue(V val) { + return false; } /** {@inheritDoc} */ - @Override public IgniteFuture<Boolean> containsKeyAsync(K key) { - return containsKeyAsync(key, null); + @Override public boolean containsKey(K key) { + try { + return containsKeyAsync(key).get(); + } + catch (IgniteCheckedException e) { + throw new IgniteException(e); + } } - /** - * @param key Key. - * @param filter Filter. - * @return Future. - */ - public IgniteFuture<Boolean> containsKeyAsync(K key, @Nullable IgnitePredicate<CacheEntry<K, V>> filter) { - return new GridFinishedFuture<>(ctx.kernalContext(), containsKey(key, filter)); + /** {@inheritDoc} */ + @Override public IgniteFuture<Boolean> containsKeyAsync(final K key) { + return getAllAsync(Collections.singletonList(key), false, null, false, null, null, false, false, null, true) + .chain(new CX1<IgniteFuture<Map<K, V>>, Boolean>() { + @Override public Boolean applyx(IgniteFuture<Map<K, V>> fut) throws IgniteCheckedException { + return fut.get().get(key) != null; + } + }); } /** {@inheritDoc} */ - @Override public boolean containsValue(V val) { - return containsValue(val, null); + @Override public IgniteFuture<Map<K, Boolean>> containsKeysAsync(Collection<? extends K> keys) { + // TODO ignite-52; + return null; } /** {@inheritDoc} */ @@ -1371,7 +1378,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, String taskName = ctx.kernalContext().job().currentTaskName(); return getAllAsync(F.asList(key), !ctx.config().isReadFromBackup(), /*skip tx*/false, entry, null, taskName, - deserializePortable).get().get(key); + deserializePortable, false).get().get(key); } /** {@inheritDoc} */ @@ -1380,7 +1387,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, String taskName = ctx.kernalContext().job().currentTaskName(); - return getAllAsync(F.asList(key), /*force primary*/true, /*skip tx*/false, null, null, taskName, true) + return getAllAsync(F.asList(key), /*force primary*/true, /*skip tx*/false, null, null, taskName, true, false) .get().get(key); } @@ -1391,7 +1398,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, String taskName = ctx.kernalContext().job().currentTaskName(); return getAllAsync(Collections.singletonList(key), /*force primary*/true, /*skip tx*/false, null, null, - taskName, true).chain(new CX1<IgniteFuture<Map<K, V>>, V>() { + taskName, true, false).chain(new CX1<IgniteFuture<Map<K, V>>, V>() { @Override public V applyx(IgniteFuture<Map<K, V>> e) throws IgniteCheckedException { return e.get().get(key); } @@ -1402,19 +1409,20 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, @Nullable @Override public Map<K, V> getAllOutTx(List<K> keys) throws IgniteCheckedException { String taskName = ctx.kernalContext().job().currentTaskName(); - return getAllAsync(keys, !ctx.config().isReadFromBackup(), /*skip tx*/true, null, null, taskName, true).get(); + return getAllAsync(keys, !ctx.config().isReadFromBackup(), /*skip tx*/true, null, null, taskName, true, false) + .get(); } /** {@inheritDoc} */ @Override public IgniteFuture<Map<K, V>> getAllOutTxAsync(List<K> keys) { String taskName = ctx.kernalContext().job().currentTaskName(); - return getAllAsync(keys, !ctx.config().isReadFromBackup(), /*skip tx*/true, null, null, taskName, true); + return getAllAsync(keys, !ctx.config().isReadFromBackup(), /*skip tx*/true, null, null, taskName, true, false); } /** {@inheritDoc} */ @Override public void reloadAll(@Nullable Collection<? extends K> keys) throws IgniteCheckedException { - reloadAll(keys, false); + reloadAll(keys, false, false); } /** {@inheritDoc} */ @@ -1442,6 +1450,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, */ public IgniteFuture<Object> readThroughAllAsync(final Collection<? extends K> keys, boolean reload, + boolean skipVals, @Nullable final IgniteTxEx<K, V> tx, @Nullable UUID subjId, String taskName, @@ -1466,12 +1475,13 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, * @return Non-{@code null} map if return flag is {@code true}. * @throws IgniteCheckedException If failed. */ - @Nullable public Map<K, V> reloadAll(@Nullable Collection<? extends K> keys, boolean ret) throws IgniteCheckedException { + @Nullable public Map<K, V> reloadAll(@Nullable Collection<? extends K> keys, boolean ret, boolean skipVals) + throws IgniteCheckedException { UUID subjId = ctx.subjectIdPerCall(null); String taskName = ctx.kernalContext().job().currentTaskName(); - return reloadAllAsync(keys, ret, subjId, taskName).get(); + return reloadAllAsync(keys, ret, skipVals, subjId, taskName).get(); } /** @@ -1479,7 +1489,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, * @param ret Return flag. * @return Future. */ - public IgniteFuture<Map<K, V>> reloadAllAsync(@Nullable Collection<? extends K> keys, boolean ret, + public IgniteFuture<Map<K, V>> reloadAllAsync(@Nullable Collection<? extends K> keys, boolean ret, boolean skipVals, @Nullable UUID subjId, String taskName) { ctx.denyOnFlag(READ); @@ -1536,7 +1546,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, final Collection<K> loadedKeys = new GridConcurrentHashSet<>(); IgniteFuture<Object> readFut = - readThroughAllAsync(absentKeys, true, null, subjId, taskName, new CI2<K, V>() { + readThroughAllAsync(absentKeys, true, skipVals, null, subjId, taskName, new CI2<K, V>() { /** Version for all loaded entries. */ private GridCacheVersion nextVer = ctx.versions().next(); @@ -1747,7 +1757,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, @Nullable GridCacheEntryEx<K, V> entry, @Nullable UUID subjId, String taskName, - boolean deserializePortable + boolean deserializePortable, + boolean skipVals ) { GridCacheProjectionImpl<K, V> prj = ctx.projectionPerCall(); @@ -1761,7 +1772,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, taskName, deserializePortable, forcePrimary, - accessExpiryPolicy(prj != null ? prj.expiry() : null)); + accessExpiryPolicy(prj != null ? prj.expiry() : null), + skipVals); } /** {@inheritDoc} */ @@ -1773,7 +1785,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, final String taskName, final boolean deserializePortable, final boolean forcePrimary, - @Nullable IgniteCacheExpiryPolicy expiry + @Nullable IgniteCacheExpiryPolicy expiry, + final boolean skipVals ) { ctx.checkSecurity(GridSecurityPermission.CACHE_READ); @@ -1887,8 +1900,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, if (misses != null && readThrough && ctx.readThrough()) { final Map<K, GridCacheVersion> loadKeys = misses; - final Collection<K> redos = new LinkedList<>(); - final IgniteTxLocalAdapter<K, V> tx0 = tx; final Collection<K> loaded = new HashSet<>(); @@ -1989,11 +2000,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } } - if (!redos.isEmpty()) - // Future recursion. - return getAllAsync(redos, forcePrimary, /*skip tx*/false, - /*entry*/null, subjId, taskName, deserializePortable); - // There were no misses. return new GridFinishedFuture<>(ctx.kernalContext(), Collections.<K, V>emptyMap()); @@ -2032,7 +2038,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, return asyncOp(tx, new AsyncOp<Map<K, V>>(keys) { @Override public IgniteFuture<Map<K, V>> op(IgniteTxLocalAdapter<K, V> tx) { - return ctx.wrapCloneMap(tx.getAllAsync(ctx, keys, cached0, deserializePortable)); + return ctx.wrapCloneMap(tx.getAllAsync(ctx, keys, cached0, deserializePortable, skipVals)); } }); } @@ -2284,22 +2290,24 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut0 = (IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>)fut; - return fut0.chain(new CX1<IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>, EntryProcessorResult<T>>() { - @Override public EntryProcessorResult<T> applyx(IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut) - throws IgniteCheckedException { - GridCacheReturn<Map<K, EntryProcessorResult<T>>> ret = fut.get(); + return fut0.chain( + new CX1<IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>, EntryProcessorResult<T>>() { + @Override public EntryProcessorResult<T> applyx( + IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut) + throws IgniteCheckedException { + GridCacheReturn<Map<K, EntryProcessorResult<T>>> ret = fut.get(); - Map<K, EntryProcessorResult<T>> resMap = ret.value(); + Map<K, EntryProcessorResult<T>> resMap = ret.value(); - if (resMap != null) { - assert resMap.isEmpty() || resMap.size() == 1 : resMap.size(); + if (resMap != null) { + assert resMap.isEmpty() || resMap.size() == 1 : resMap.size(); - return resMap.isEmpty() ? null : resMap.values().iterator().next(); - } + return resMap.isEmpty() ? null : resMap.values().iterator().next(); + } - return null; - } - }); + return null; + } + }); } /** {@inheritDoc} */ @@ -2333,16 +2341,18 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut0 = (IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>)fut; - return fut0.chain(new CX1<IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>, Map<K, EntryProcessorResult<T>>>() { - @Override public Map<K, EntryProcessorResult<T>> applyx(IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut) - throws IgniteCheckedException { - GridCacheReturn<Map<K, EntryProcessorResult<T>>> ret = fut.get(); + return fut0.chain( + new CX1<IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>>, Map<K, EntryProcessorResult<T>>>() { + @Override public Map<K, EntryProcessorResult<T>> applyx( + IgniteFuture<GridCacheReturn<Map<K, EntryProcessorResult<T>>>> fut) + throws IgniteCheckedException { + GridCacheReturn<Map<K, EntryProcessorResult<T>>> ret = fut.get(); - assert ret != null; + assert ret != null; - return ret.value() != null ? ret.value() : Collections.<K, EntryProcessorResult<T>>emptyMap(); - } - }); + return ret.value() != null ? ret.value() : Collections.<K, EntryProcessorResult<T>>emptyMap(); + } + }); } /** {@inheritDoc} */ @@ -2779,7 +2789,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, @Override public IgniteFuture<V> op(IgniteTxLocalAdapter<K, V> tx) { // TODO should we invoke interceptor here? return tx.removeAllAsync(ctx, Collections.singletonList(key), null, true, filter) - .chain((IgniteClosure<IgniteFuture<GridCacheReturn<V>>, V>) RET2VAL); + .chain((IgniteClosure<IgniteFuture<GridCacheReturn<V>>, V>)RET2VAL); } @Override public String toString() { @@ -4346,123 +4356,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, /** * @param key Key. - * @param filter Filters to evaluate. - * @return {@code True} if contains key. - */ - public boolean containsKey(K key, @Nullable IgnitePredicate<CacheEntry<K, V>> filter) { - A.notNull(key, "key"); - - if (keyCheck) - validateCacheKey(key); - - if (ctx.portableEnabled()) { - try { - key = (K)ctx.marshalToPortable(key); - } - catch (PortableException e) { - throw new IgniteException(e); - } - } - - GridCacheEntryEx<K, V> e = peekEx(key); - - try { - return e != null && e.peek(SMART, filter) != null; - } - catch (GridCacheEntryRemovedException ignore) { - if (log.isDebugEnabled()) - log.debug("Got removed entry during peek (will ignore): " + e); - - return false; - } - } - - /** - * @param keys Keys. - * @param filter Filter to evaluate. - * @return {@code True} if contains all keys. - */ - public boolean containsAllKeys(@Nullable Collection<? extends K> keys, - @Nullable IgnitePredicate<CacheEntry<K, V>> filter) { - if (F.isEmpty(keys)) - return true; - - if (keyCheck) - validateCacheKeys(keys); - - for (K k : keys) - if (!containsKey(k, filter)) - return false; - - return true; - } - - /** - * @param keys Keys. - * @param filter Filter to evaluate. - * @return {@code True} if cache contains any of given keys. - */ - public boolean containsAnyKeys(@Nullable Collection<? extends K> keys, - @Nullable IgnitePredicate<CacheEntry<K, V>> filter) { - if (F.isEmpty(keys)) - return true; - - if (keyCheck) - validateCacheKeys(keys); - - for (K k : keys) { - if (containsKey(k, filter)) - return true; - } - - return false; - } - - /** - * @param val Value. - * @param filter Filter to evaluate. - * @return {@code True} if contains value. - */ - public boolean containsValue(V val, @Nullable IgnitePredicate<CacheEntry<K, V>> filter) { - A.notNull(val, "val"); - - validateCacheValue(val); - - return values(filter).contains(val); - } - - /** - * @param vals Values. - * @param filter Filter to evaluate. - * @return {@code True} if contains all given values. - */ - public boolean containsAllValues(@Nullable Collection<? extends V> vals, - @Nullable IgnitePredicate<CacheEntry<K, V>> filter) { - if (F.isEmpty(vals)) - return true; - - validateCacheValues(vals); - - return values(filter).containsAll(vals); - } - - /** - * @param vals Values. - * @param filter Filter to evaluate. - * @return {@code True} if contains any of given values. - */ - public boolean containsAnyValues(@Nullable Collection<? extends V> vals, - @Nullable IgnitePredicate<CacheEntry<K, V>> filter) { - if (F.isEmpty(vals)) - return true; - - validateCacheValues(vals); - - return !values(F.and(filter, F.<K, V>cacheContainsPeek(vals))).isEmpty(); - } - - /** - * @param key Key. * @param filter Filter to evaluate. * @return Peeked value. */ @@ -4642,7 +4535,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, String taskName = ctx.kernalContext().job().currentTaskName(); - return reloadAllAsync(keys, false, subjId, taskName); + return reloadAllAsync(keys, false, false, subjId, taskName); } /** @@ -4682,7 +4575,8 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, null, null, taskName, - deserializePortable); + deserializePortable, + false); } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/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 fa21788..36770cd 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 @@ -609,17 +609,22 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V /** {@inheritDoc} */ @Override public boolean containsKey(K key) { - return cache.containsKey(key, entryFilter(true)); + return cache.containsKey(key); } /** {@inheritDoc} */ @Override public IgniteFuture<Boolean> containsKeyAsync(K key) { - return cache.containsKeyAsync(key, entryFilter(false)); + return cache.containsKeyAsync(key); + } + + /** {@inheritDoc} */ + @Override public IgniteFuture<Map<K, Boolean>> containsKeysAsync(Collection<? extends K> keys) { + return cache.containsKeysAsync(keys); } /** {@inheritDoc} */ @Override public boolean containsValue(V val) { - return cache.containsValue(val, entryFilter(true)); + return cache.containsValue(val); } /** {@inheritDoc} */ @@ -1275,7 +1280,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public @Nullable ExpiryPolicy expiry() { + @Nullable @Override public ExpiryPolicy expiry() { return expiryPlc; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/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 504fe7f..1c769b0 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 @@ -352,6 +352,18 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ + @Override public IgniteFuture<Map<K, Boolean>> containsKeysAsync(Collection<? extends K> keys) { + GridCacheProjectionImpl<K, V> prev = gate.enter(prj); + + try { + return delegate.containsKeysAsync(keys); + } + finally { + gate.leave(prev); + } + } + + /** {@inheritDoc} */ @Override public boolean containsValue(V val) { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java index 129dc54..8c311f5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java @@ -1202,6 +1202,18 @@ public class GridCacheUtils { } /** + * @param val Value. + * @param skip Skip value flag. + * @return Value. + */ + public static Object skipValue(Object val, boolean skip) { + if (skip) + return val != null ? true : null; + else + return val; + } + + /** * @param ctx Context. * @param prj Projection. * @param concurrency Concurrency. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/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 876ce25..5de9af7 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 @@ -477,7 +477,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap /** * This method is used internally. Use - * {@link #getDhtAsync(UUID, long, LinkedHashMap, boolean, boolean, long, UUID, int, boolean, IgniteCacheExpiryPolicy)} + * {@link #getDhtAsync(UUID, long, LinkedHashMap, boolean, boolean, long, UUID, int, boolean, IgniteCacheExpiryPolicy, boolean)} * method instead to retrieve DHT value. * * @param keys {@inheritDoc} @@ -492,7 +492,8 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap @Nullable GridCacheEntryEx<K, V> entry, @Nullable UUID subjId, String taskName, - boolean deserializePortable + boolean deserializePortable, + boolean skipVals ) { return getAllAsync(keys, true, @@ -502,7 +503,8 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap taskName, deserializePortable, forcePrimary, - null); + null, + skipVals); } /** {@inheritDoc} */ @@ -530,7 +532,8 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap @Nullable UUID subjId, String taskName, boolean deserializePortable, - @Nullable IgniteCacheExpiryPolicy expiry + @Nullable IgniteCacheExpiryPolicy expiry, + boolean skipVals ) { return getAllAsync(keys, readThrough, @@ -540,7 +543,8 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap taskName, deserializePortable, false, - expiry); + expiry, + skipVals); } /** @@ -565,7 +569,8 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap @Nullable UUID subjId, int taskNameHash, boolean deserializePortable, - @Nullable IgniteCacheExpiryPolicy expiry) { + @Nullable IgniteCacheExpiryPolicy expiry, + boolean skipVals) { GridDhtGetFuture<K, V> fut = new GridDhtGetFuture<>(ctx, msgId, reader, @@ -577,7 +582,8 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap subjId, taskNameHash, deserializePortable, - expiry); + expiry, + skipVals); fut.init(); @@ -605,7 +611,8 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap req.subjectId(), req.taskNameHash(), false, - expiryPlc); + expiryPlc, + req.skipValues()); fut.listenAsync(new CI1<IgniteFuture<Collection<GridCacheEntryInfo<K, V>>>>() { @Override public void apply(IgniteFuture<Collection<GridCacheEntryInfo<K, V>>> f) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java index 1673412..ddbe518 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java @@ -94,6 +94,9 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col /** Expiry policy. */ private IgniteCacheExpiryPolicy expiryPlc; + /** Skip values flag. */ + private boolean skipVals; + /** * Empty constructor required for {@link Externalizable}. */ @@ -114,6 +117,7 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col * @param taskNameHash Task name hash code. * @param deserializePortable Deserialize portable flag. * @param expiryPlc Expiry policy. + * @param skipVals Skip values flag. */ public GridDhtGetFuture( GridCacheContext<K, V> cctx, @@ -127,7 +131,9 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col @Nullable UUID subjId, int taskNameHash, boolean deserializePortable, - @Nullable IgniteCacheExpiryPolicy expiryPlc) { + @Nullable IgniteCacheExpiryPolicy expiryPlc, + boolean skipVals + ) { super(cctx.kernalContext(), CU.<GridCacheEntryInfo<K, V>>collectionsReducer()); assert reader != null; @@ -145,6 +151,7 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col this.deserializePortable = deserializePortable; this.taskNameHash = taskNameHash; this.expiryPlc = expiryPlc; + this.skipVals = skipVals; futId = IgniteUuid.randomUuid(); @@ -345,6 +352,7 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col if (reload && cctx.readThrough() && cctx.store().configured()) { fut = cache().reloadAllAsync(keys.keySet(), true, + skipVals, subjId, taskName); } @@ -355,13 +363,15 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col subjId, taskName, deserializePortable, - expiryPlc); + expiryPlc, + skipVals); } else { fut = tx.getAllAsync(cctx, keys.keySet(), null, - deserializePortable); + deserializePortable, + skipVals); } } } @@ -379,6 +389,7 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col if (reload && cctx.readThrough() && cctx.store().configured()) { return cache().reloadAllAsync(keys.keySet(), true, + skipVals, subjId, taskName); } @@ -389,13 +400,14 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col subjId, taskName, deserializePortable, - expiryPlc); + expiryPlc, skipVals); } else { return tx.getAllAsync(cctx, keys.keySet(), null, - deserializePortable); + deserializePortable, + skipVals); } } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java index 80684f3..4f12edb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java @@ -98,6 +98,9 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M /** Expiry policy. */ private IgniteCacheExpiryPolicy expiryPlc; + /** Skip values flag. */ + private boolean skipVals; + /** * Empty constructor required for {@link Externalizable}. */ @@ -117,6 +120,7 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M * @param taskName Task name. * @param deserializePortable Deserialize portable flag. * @param expiryPlc Expiry policy. + * @param skipVals Skip values flag. */ public GridPartitionedGetFuture( GridCacheContext<K, V> cctx, @@ -128,7 +132,8 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M @Nullable UUID subjId, String taskName, boolean deserializePortable, - @Nullable IgniteCacheExpiryPolicy expiryPlc + @Nullable IgniteCacheExpiryPolicy expiryPlc, + boolean skipVals ) { super(cctx.kernalContext(), CU.<K, V>mapsReducer(keys.size())); @@ -144,6 +149,7 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M this.deserializePortable = deserializePortable; this.taskName = taskName; this.expiryPlc = expiryPlc; + this.skipVals = skipVals; futId = IgniteUuid.randomUuid(); @@ -318,7 +324,8 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M subjId, taskName == null ? 0 : taskName.hashCode(), deserializePortable, - expiryPlc); + expiryPlc, + skipVals); final Collection<Integer> invalidParts = fut.invalidPartitions(); @@ -370,7 +377,8 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M topVer, subjId, taskName == null ? 0 : taskName.hashCode(), - expiryPlc != null ? expiryPlc.forAccess() : -1L); + expiryPlc != null ? expiryPlc.forAccess() : -1L, + skipVals); add(fut); // Append new future. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/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 882dd2b..09fc94c 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 @@ -268,7 +268,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> { @Nullable final GridCacheEntryEx<K, V> entry, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable + final boolean deserializePortable, + final boolean skipVals ) { GridCacheProjectionImpl<K, V> prj = ctx.projectionPerCall(); @@ -286,7 +287,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> { subjId0, taskName, deserializePortable, - expiryPlc); + expiryPlc, + skipVals); } }); } @@ -841,6 +843,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> { * @param taskName Task name. * @param deserializePortable Deserialize portable flag. * @param expiryPlc Expiry policy. + * @param skipVals Skip values flag. * @return Get future. */ private IgniteFuture<Map<K, V>> getAllAsync0(@Nullable Collection<? extends K> keys, @@ -849,7 +852,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> { UUID subjId, String taskName, boolean deserializePortable, - @Nullable ExpiryPolicy expiryPlc) { + @Nullable ExpiryPolicy expiryPlc, + boolean skipVals) { ctx.checkSecurity(GridSecurityPermission.CACHE_READ); if (F.isEmpty(keys)) @@ -961,7 +965,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> { subjId, taskName, deserializePortable, - expiry); + expiry, + skipVals); fut.init(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/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 e09686a..07d000c 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 @@ -158,7 +158,8 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte @Nullable final GridCacheEntryEx<K, V> entry, @Nullable UUID subjId, String taskName, - final boolean deserializePortable + final boolean deserializePortable, + final boolean skipVals ) { ctx.denyOnFlag(LOCAL); ctx.checkSecurity(GridSecurityPermission.CACHE_READ); @@ -171,7 +172,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte if (tx != null && !tx.implicit() && !skipTx) { return asyncOp(tx, new AsyncOp<Map<K, V>>(keys) { @Override public IgniteFuture<Map<K, V>> op(IgniteTxLocalAdapter<K, V> tx) { - return ctx.wrapCloneMap(tx.getAllAsync(ctx, keys, entry, deserializePortable)); + return ctx.wrapCloneMap(tx.getAllAsync(ctx, keys, entry, deserializePortable, skipVals)); } }); } @@ -190,7 +191,8 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte subjId, taskName, deserializePortable, - accessExpiryPolicy(prj != null ? prj.expiry() : null)); + accessExpiryPolicy(prj != null ? prj.expiry() : null), + skipVals); } /** {@inheritDoc} */ @@ -203,25 +205,6 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte } } - /** {@inheritDoc} */ - @Override public boolean containsKey(K key, @Nullable IgnitePredicate<CacheEntry<K, V>> filter) { - A.notNull(key, "key"); - - // We need detached entry here because if there is an ongoing transaction, - // we should see this entry and apply filter. - GridCacheEntryEx<K, V> e = entryExx(key, ctx.affinity().affinityTopologyVersion(), true, true); - - try { - return e != null && e.peek(SMART, filter) != null; - } - catch (GridCacheEntryRemovedException ignore) { - if (log.isDebugEnabled()) - log.debug("Got removed entry during peek (will ignore): " + e); - - return false; - } - } - /** * @param keys Keys to load. * @param readThrough Read through flag. @@ -242,7 +225,9 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte @Nullable UUID subjId, String taskName, boolean deserializePortable, - @Nullable IgniteCacheExpiryPolicy expiryPlc) { + @Nullable IgniteCacheExpiryPolicy expiryPlc, + boolean skipVals + ) { if (keys == null || keys.isEmpty()) return new GridFinishedFuture<>(ctx.kernalContext(), Collections.<K, V>emptyMap()); @@ -254,7 +239,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte // Optimisation: try to resolve value locally and escape 'get future' creation. if (!reload && !forcePrimary) { - Map<K, V> locVals = new HashMap<>(keys.size(), 1.0f); + Map<K, V> locVals = U.newHashMap(keys.size()); boolean success = true; @@ -293,10 +278,10 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte success = false; } else { - if (ctx.portableEnabled()) + if (ctx.portableEnabled() && !skipVals) v = (V)ctx.unwrapPortableIfNeeded(v, !deserializePortable); - locVals.put(key, v); + locVals.put(key, (V)CU.skipValue(v, skipVals)); } } else @@ -349,7 +334,8 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte subjId, taskName, deserializePortable, - expiryPlc); + expiryPlc, + skipVals); fut.init(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/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 19686a8..24c9203 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 @@ -368,7 +368,8 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> { @Nullable GridCacheEntryEx<K, V> entry, @Nullable UUID subjId, String taskName, - boolean deserializePortable + boolean deserializePortable, + boolean skipVals ) { ctx.denyOnFlag(LOCAL); ctx.checkSecurity(GridSecurityPermission.CACHE_READ); @@ -387,7 +388,8 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> { subjId, taskName, deserializePortable, - prj != null ? prj.expiry() : null); + prj != null ? prj.expiry() : null, + skipVals); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/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 f332c12..02fb6a7 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 @@ -171,9 +171,15 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda /** {@inheritDoc} */ @SuppressWarnings({"unchecked", "RedundantCast"}) - @Override public IgniteFuture<Object> readThroughAllAsync(Collection<? extends K> keys, boolean reload, - IgniteTxEx<K, V> tx, @Nullable UUID subjId, String taskName, - IgniteBiInClosure<K, V> vis) { + @Override public IgniteFuture<Object> readThroughAllAsync( + Collection<? extends K> keys, + boolean reload, + boolean skipVals, + IgniteTxEx<K, V> tx, + @Nullable UUID subjId, + String taskName, + IgniteBiInClosure<K, V> vis + ) { return (IgniteFuture)loadAsync(tx, keys, reload, @@ -181,7 +187,8 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda subjId, taskName, true, - null); + null, + skipVals); } /** {@inheritDoc} */ @@ -260,7 +267,9 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda @Nullable UUID subjId, String taskName, boolean deserializePortable, - @Nullable ExpiryPolicy expiryPlc) { + @Nullable ExpiryPolicy expiryPlc, + boolean skipVal + ) { if (F.isEmpty(keys)) return new GridFinishedFuture<>(ctx.kernalContext(), Collections.<K, V>emptyMap()); @@ -280,7 +289,8 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda subjId, taskName, deserializePortable, - expiry); + expiry, + skipVal); // init() will register future for responses if future has remote mappings. fut.init(); @@ -424,11 +434,6 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda } /** {@inheritDoc} */ - @Override public boolean containsKey(K key, IgnitePredicate<CacheEntry<K, V>> filter) { - return super.containsKey(key, filter) || dht().containsKey(key, filter); - } - - /** {@inheritDoc} */ @Override public boolean evict(K key, @Nullable IgnitePredicate<CacheEntry<K, V>>[] filter) { // Use unary 'and' to make sure that both sides execute. return super.evict(key, filter) & dht().evict(key, filter); @@ -691,7 +696,7 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda return new EntryIterator(nearSet.iterator(), F.iterator0(dhtSet, false, new P1<CacheEntry<K, V>>() { @Override public boolean apply(CacheEntry<K, V> e) { - return !GridNearCacheAdapter.super.containsKey(e.getKey(), null); + return !GridNearCacheAdapter.super.containsKey(e.getKey()); } })); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java index 4d4281f..2a9621a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java @@ -322,7 +322,8 @@ public class GridNearCacheEntry<K, V> extends GridDistributedCacheEntry<K, V> { subjId, taskName, true, - null).get().get(key); + null, + false).get().get(key); } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java index 96dd3fc..1ebe76f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java @@ -98,6 +98,9 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma /** Whether to deserialize portable objects. */ private boolean deserializePortable; + /** Skip values flag. */ + private boolean skipVals; + /** Expiry policy. */ private IgniteCacheExpiryPolicy expiryPlc; @@ -120,6 +123,7 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma * @param taskName Task name. * @param deserializePortable Deserialize portable flag. * @param expiryPlc Expiry policy. + * @param skipVals Skip values flag. */ public GridNearGetFuture( GridCacheContext<K, V> cctx, @@ -131,7 +135,8 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma @Nullable UUID subjId, String taskName, boolean deserializePortable, - @Nullable IgniteCacheExpiryPolicy expiryPlc + @Nullable IgniteCacheExpiryPolicy expiryPlc, + boolean skipVals ) { super(cctx.kernalContext(), CU.<K, V>mapsReducer(keys.size())); @@ -147,6 +152,7 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma this.taskName = taskName; this.deserializePortable = deserializePortable; this.expiryPlc = expiryPlc; + this.skipVals = skipVals; futId = IgniteUuid.randomUuid(); @@ -318,7 +324,8 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma subjId, taskName == null ? 0 : taskName.hashCode(), deserializePortable, - expiryPlc); + expiryPlc, + skipVals); final Collection<Integer> invalidParts = fut.invalidPartitions(); @@ -376,7 +383,8 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma topVer, subjId, taskName == null ? 0 : taskName.hashCode(), - expiryPlc != null ? expiryPlc.forAccess() : -1L); + expiryPlc != null ? expiryPlc.forAccess() : -1L, + skipVals); add(fut); // Append new future. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java index cee13c2..1166e11 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java @@ -58,6 +58,9 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements /** Read through flag. */ private boolean readThrough; + /** Skip values flag. Used for {@code containsKey} method. */ + private boolean skipVals; + /** */ @GridToStringExclude @GridDirectMap(keyType = byte[].class, valueType = boolean.class) @@ -92,6 +95,8 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements * @param keys Keys. * @param readThrough Read through flag. * @param reload Reload flag. + * @param skipVals Skip values flag. When false, only boolean values will be returned indicating whether + * cache entry has a value. * @param topVer Topology version. * @param subjId Subject ID. * @param taskNameHash Task name hash. @@ -108,7 +113,8 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements long topVer, UUID subjId, int taskNameHash, - long accessTtl + long accessTtl, + boolean skipVals ) { assert futId != null; assert miniId != null; @@ -126,6 +132,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements this.subjId = subjId; this.taskNameHash = taskNameHash; this.accessTtl = accessTtl; + this.skipVals = skipVals; } /** @@ -185,6 +192,14 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements } /** + * @return Skip values flag. If true, boolean values indicating whether cache entry has a value will be + * returned as future result. + */ + public boolean skipValues() { + return skipVals; + } + + /** * @return Topology version. */ @Override public long topologyVersion() { @@ -246,6 +261,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements _clone.keys = keys; _clone.reload = reload; _clone.readThrough = readThrough; + _clone.skipVals = skipVals; _clone.keyBytes = keyBytes; _clone.topVer = topVer; _clone.subjId = subjId; @@ -361,6 +377,11 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements commState.idx++; + case 13: + if (!commState.putBoolean(skipVals)) + return false; + + commState.idx++; } return true; @@ -497,6 +518,13 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements commState.idx++; + case 13: + if (buf.remaining() < 1) + return false; + + skipVals = commState.getBoolean(); + + commState.idx++; } return true; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/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 418906d..8e62f72 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 @@ -99,7 +99,8 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V> @Nullable final GridCacheEntryEx<K, V> entry, @Nullable UUID subjId, String taskName, - final boolean deserializePortable + final boolean deserializePortable, + final boolean skipVals ) { ctx.denyOnFlag(LOCAL); ctx.checkSecurity(GridSecurityPermission.CACHE_READ); @@ -112,7 +113,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V> if (tx != null && !tx.implicit() && !skipTx) { return asyncOp(tx, new AsyncOp<Map<K, V>>(keys) { @Override public IgniteFuture<Map<K, V>> op(IgniteTxLocalAdapter<K, V> tx) { - return ctx.wrapCloneMap(tx.getAllAsync(ctx, keys, entry, deserializePortable)); + return ctx.wrapCloneMap(tx.getAllAsync(ctx, keys, entry, deserializePortable, skipVals)); } }); } @@ -128,7 +129,8 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V> subjId, taskName, deserializePortable, - prj != null ? prj.expiry() : null); + prj != null ? prj.expiry() : null, + skipVals); } /** @@ -143,7 +145,8 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V> @Nullable Collection<? extends K> keys, boolean readThrough, boolean deserializePortable, - @Nullable IgniteCacheExpiryPolicy expiryPlc) { + @Nullable IgniteCacheExpiryPolicy expiryPlc, + boolean skipVals) { assert tx != null; GridNearGetFuture<K, V> fut = new GridNearGetFuture<>(ctx, @@ -155,7 +158,8 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V> CU.subjectId(tx, ctx.shared()), tx.resolveTaskName(), deserializePortable, - expiryPlc); + expiryPlc, + skipVals); // init() will register future for responses if it has remote mappings. fut.init(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/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 e9fefd0..f72a4a2 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 @@ -81,7 +81,7 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K, V> { private boolean colocatedLocallyMapped; /** Info for entries accessed locally in optimistic transaction. */ - private Map<IgniteTxKey, IgniteCacheExpiryPolicy> accessMap; + private Map<IgniteTxKey<K>, IgniteCacheExpiryPolicy> accessMap; /** * Empty constructor required for {@link Externalizable}. @@ -283,6 +283,7 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K, V> { boolean async, final Collection<? extends K> keys, boolean deserializePortable, + boolean skipVals, final IgniteBiInClosure<K, V> c ) { if (cacheCtx.isNear()) { @@ -290,7 +291,8 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K, V> { keys, readThrough, deserializePortable, - accessPolicy(cacheCtx, keys)).chain(new C1<IgniteFuture<Map<K, V>>, Boolean>() { + accessPolicy(cacheCtx, keys), + skipVals).chain(new C1<IgniteFuture<Map<K, V>>, Boolean>() { @Override public Boolean apply(IgniteFuture<Map<K, V>> f) { try { Map<K, V> map = f.get(); @@ -319,7 +321,8 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K, V> { CU.subjectId(this, cctx), resolveTaskName(), deserializePortable, - accessPolicy(cacheCtx, keys)).chain(new C1<IgniteFuture<Map<K, V>>, Boolean>() { + accessPolicy(cacheCtx, keys), + skipVals).chain(new C1<IgniteFuture<Map<K, V>>, Boolean>() { @Override public Boolean apply(IgniteFuture<Map<K, V>> f) { try { Map<K, V> map = f.get(); @@ -342,7 +345,7 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K, V> { else { assert cacheCtx.isLocal(); - return super.loadMissing(cacheCtx, readThrough, async, keys, deserializePortable, c); + return super.loadMissing(cacheCtx, readThrough, async, keys, deserializePortable, skipVals, c); } } @@ -1170,10 +1173,11 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K, V> { } /** {@inheritDoc} */ - @Override protected IgniteCacheExpiryPolicy accessPolicy(GridCacheContext ctx, - IgniteTxKey key, - @Nullable ExpiryPolicy expiryPlc) - { + @Override protected IgniteCacheExpiryPolicy accessPolicy( + GridCacheContext ctx, + IgniteTxKey<K> key, + @Nullable ExpiryPolicy expiryPlc + ) { assert optimistic(); if (expiryPlc == null) @@ -1202,7 +1206,7 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K, V> { */ private IgniteCacheExpiryPolicy accessPolicy(GridCacheContext<K, V> cacheCtx, Collection<? extends K> keys) { if (accessMap != null) { - for (Map.Entry<IgniteTxKey, IgniteCacheExpiryPolicy> e : accessMap.entrySet()) { + for (Map.Entry<IgniteTxKey<K>, IgniteCacheExpiryPolicy> e : accessMap.entrySet()) { if (e.getKey().cacheId() == cacheCtx.cacheId() && keys.contains(e.getKey().key())) return e.getValue(); } @@ -1218,7 +1222,7 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K, V> { if (accessMap != null) { assert optimistic(); - for (Map.Entry<IgniteTxKey, IgniteCacheExpiryPolicy> e : accessMap.entrySet()) { + for (Map.Entry<IgniteTxKey<K>, IgniteCacheExpiryPolicy> e : accessMap.entrySet()) { if (e.getValue().entries() != null) { GridCacheContext cctx0 = cctx.cacheContext(e.getKey().cacheId()); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/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 f45f0a1..bd5f22a 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 @@ -476,7 +476,8 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> { ctx.readThrough(), ctx.hasFlag(CLONE), taskName, - deserializePortable); + deserializePortable, + false); return m.get(key); } @@ -494,7 +495,8 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> { ctx.readThrough(), ctx.hasFlag(CLONE), taskName, - deserializePortable); + deserializePortable, + false); } @@ -507,7 +509,8 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> { @Nullable final GridCacheEntryEx<K, V> entry, @Nullable UUID subjId, final String taskName, - final boolean deserializePortable + final boolean deserializePortable, + final boolean skipVals ) { ctx.denyOnFlag(LOCAL); @@ -517,7 +520,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> { return asyncOp(new Callable<Map<K, V>>() { @Override public Map<K, V> call() throws Exception { - return getAllInternal(keys, swapOrOffheap, storeEnabled, clone, taskName, deserializePortable); + return getAllInternal(keys, swapOrOffheap, storeEnabled, clone, taskName, deserializePortable, skipVals); } }); } @@ -540,7 +543,9 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> { boolean storeEnabled, boolean clone, String taskName, - boolean deserializePortable) throws IgniteCheckedException { + boolean deserializePortable, + boolean skipVals + ) throws IgniteCheckedException { ctx.checkSecurity(GridSecurityPermission.CACHE_READ); if (F.isEmpty(keys)) @@ -631,7 +636,8 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> { return map; } - return getAllAsync(keys, true, null, false, subjId, taskName, deserializePortable, false, expiry).get(); + return getAllAsync(keys, true, null, false, subjId, taskName, deserializePortable, false, expiry, skipVals) + .get(); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/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 54e778e..1d5b42f 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 @@ -309,6 +309,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K, V> boolean async, final Collection<? extends K> keys, boolean deserializePortable, + boolean skipVals, final IgniteBiInClosure<K, V> c ) { if (!async) { @@ -1025,7 +1026,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K, V> /** * Checks if there is a cached or swapped value for - * {@link #getAllAsync(GridCacheContext, Collection, GridCacheEntryEx, boolean)} method. + * {@link #getAllAsync(GridCacheContext, Collection, GridCacheEntryEx, boolean, boolean)} method. * * @param cacheCtx Cache context. * @param keys Key to enlist. @@ -1274,9 +1275,11 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K, V> * @param expiryPlc Expiry policy. * @return Expiry policy wrapper for entries accessed locally in optimistic transaction. */ - protected IgniteCacheExpiryPolicy accessPolicy(GridCacheContext ctx, - IgniteTxKey key, - @Nullable ExpiryPolicy expiryPlc) { + protected IgniteCacheExpiryPolicy accessPolicy( + GridCacheContext ctx, + IgniteTxKey<K> key, + @Nullable ExpiryPolicy expiryPlc + ) { return null; } @@ -1301,7 +1304,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K, V> /** * Loads all missed keys for - * {@link #getAllAsync(GridCacheContext, Collection, GridCacheEntryEx, boolean)} method. + * {@link #getAllAsync(GridCacheContext, Collection, GridCacheEntryEx, boolean, boolean)} method. * * @param cacheCtx Cache context. * @param map Return map. @@ -1315,7 +1318,8 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K, V> final Map<K, V> map, final Map<K, GridCacheVersion> missedMap, @Nullable final Collection<K> redos, - final boolean deserializePortable + final boolean deserializePortable, + boolean skipVals ) { assert redos != null || pessimistic(); @@ -1327,7 +1331,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K, V> return new GridEmbeddedFuture<>(cctx.kernalContext(), loadMissing( cacheCtx, - true, false, missedMap.keySet(), deserializePortable, new CI2<K, V>() { + true, false, missedMap.keySet(), deserializePortable, skipVals, new CI2<K, V>() { /** */ private GridCacheVersion nextVer; @@ -1483,7 +1487,8 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K, V> final GridCacheContext<K, V> cacheCtx, Collection<? extends K> keys, @Nullable GridCacheEntryEx<K, V> cached, - final boolean deserializePortable) { + final boolean deserializePortable, + final boolean skipVals) { if (F.isEmpty(keys)) return new GridFinishedFuture<>(cctx.kernalContext(), Collections.<K, V>emptyMap()); @@ -1619,7 +1624,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K, V> } if (!missed.isEmpty() && (cacheCtx.isReplicated() || cacheCtx.isLocal())) - return checkMissed(cacheCtx, retMap, missed, null, deserializePortable); + return checkMissed(cacheCtx, retMap, missed, null, deserializePortable, skipVals); return new GridFinishedFuture<>(cctx.kernalContext(), Collections.<K, V>emptyMap()); } @@ -1678,7 +1683,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K, V> return new GridEmbeddedFuture<>( cctx.kernalContext(), // First future. - checkMissed(cacheCtx, retMap, missed, redos, deserializePortable), + checkMissed(cacheCtx, retMap, missed, redos, deserializePortable, skipVals), // Closure that returns another future, based on result from first. new PMC<Map<K, V>>() { @Override public IgniteFuture<Map<K, V>> postMiss(Map<K, V> map) { @@ -1690,7 +1695,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K, V> log.debug("Starting to future-recursively get values for keys: " + redos); // Future recursion. - return getAllAsync(cacheCtx, redos, null, deserializePortable); + return getAllAsync(cacheCtx, redos, null, deserializePortable, skipVals); } }, // Finalize. @@ -2031,6 +2036,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K, V> true, F.asList(key), deserializePortables(cacheCtx), + false, new CI2<K, V>() { @Override public void apply(K k, V v) { if (log.isDebugEnabled()) @@ -2167,10 +2173,11 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K, V> IgniteFuture<Boolean> fut = loadMissing( cacheCtx, - true, - true, + /*read through*/true, + /*async*/true, missedForInvoke, deserializePortables(cacheCtx), + /*skip values*/false, new CI2<K, V>() { @Override public void apply(K key, V val) { if (log.isDebugEnabled()) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java index 7cd0ff9..ea51199 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java @@ -73,7 +73,8 @@ public interface IgniteTxLocalEx<K, V> extends IgniteTxEx<K, V> { GridCacheContext<K, V> cacheCtx, Collection<? extends K> keys, @Nullable GridCacheEntryEx<K, V> cached, - boolean deserializePortable); + boolean deserializePortable, + boolean skipVals); /** * @param cacheCtx Cache context. @@ -166,6 +167,7 @@ public interface IgniteTxLocalEx<K, V> extends IgniteTxEx<K, V> { * @param keys Keys. * @param c Closure. * @param deserializePortable Deserialize portable flag. + * @param skipVals Skip values flag. * @return Future with {@code True} value if loading took place. */ public IgniteFuture<Boolean> loadMissing( @@ -174,5 +176,6 @@ public interface IgniteTxLocalEx<K, V> extends IgniteTxEx<K, V> { boolean async, Collection<? extends K> keys, boolean deserializePortable, + boolean skipVals, IgniteBiInClosure<K, V> c); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java index cf164d4..28b07a9 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java @@ -243,7 +243,7 @@ public class GridCachePreloadingEvictionsSelfTest extends GridCommonAbstractTest Object e = cache1.peek(key); if (e != null) - assert cache2.containsKey(key, null) : "Cache2 does not contain key: " + key; + assert cache2.containsKey(key) : "Cache2 does not contain key: " + key; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f14e1aa4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java index 10e60c2..c717e31 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java @@ -85,7 +85,7 @@ public class GridCacheQueryInternalKeysSelfTest extends GridCacheAbstractSelfTes assertNotNull(g); assertTrue("Affinity node doesn't contain internal key [key=" + internalKey + ", node=" + n + ']', - ((GridNearCacheAdapter)((GridKernal)g).internalCache()).dht().containsKey(internalKey, null)); + ((GridNearCacheAdapter)((GridKernal)g).internalCache()).dht().containsKey(internalKey)); } } }