# Fixed bug in GridCacheAdapter.containsKeysAsync().
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/88760b72 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/88760b72 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/88760b72 Branch: refs/heads/ignite-141 Commit: 88760b72158b08489f0a9f8e827a92d88da36d44 Parents: ae413fb Author: vozerov-gridgain <voze...@gridgain.com> Authored: Thu Mar 5 12:34:26 2015 +0300 Committer: vozerov-gridgain <voze...@gridgain.com> Committed: Thu Mar 5 12:34:26 2015 +0300 ---------------------------------------------------------------------- .../internal/processors/cache/GridCacheAdapter.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/88760b72/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 fe88012..b8ed1d2 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 @@ -689,16 +689,20 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, @Override public IgniteInternalFuture<Boolean> containsKeysAsync(Collection<? extends K> keys) { A.notNull(keys, "keys"); + final Collection<? extends K> keys0; + if (ctx.portableEnabled() && !F.isEmpty(keys)) { - keys = F.viewReadOnly(keys, new C1<K, K>() { + keys0 = F.viewReadOnly(keys, new C1<K, K>() { @Override public K apply(K k) { return (K)ctx.marshalToPortable(k); } }); } + else + keys0 = keys; return getAllAsync( - keys, + keys0, /*force primary*/false, /*skip tx*/false, /*entry*/null, @@ -710,6 +714,9 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, @Override public Boolean applyx(IgniteInternalFuture<Map<K, V>> fut) throws IgniteCheckedException { Map<K, V> kvMap = fut.get(); + if (keys0.size() != kvMap.size()) + return false; + for (Map.Entry<K, V> entry : kvMap.entrySet()) { if (entry.getValue() == null) return false;