Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 980E717450 for ; Thu, 23 Apr 2015 18:13:27 +0000 (UTC) Received: (qmail 68266 invoked by uid 500); 23 Apr 2015 18:13:27 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 68192 invoked by uid 500); 23 Apr 2015 18:13:27 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 68095 invoked by uid 99); 23 Apr 2015 18:13:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2015 18:13:27 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [54.164.171.186] (HELO mx1-us-east.apache.org) (54.164.171.186) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2015 18:13:18 +0000 Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id F2C9243E41 for ; Thu, 23 Apr 2015 18:12:57 +0000 (UTC) Received: (qmail 66751 invoked by uid 99); 23 Apr 2015 18:12:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2015 18:12:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 61263E17E4; Thu, 23 Apr 2015 18:12:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Thu, 23 Apr 2015 18:13:01 -0000 Message-Id: <23731a85874b46e293499f0ef14ad019@git.apache.org> In-Reply-To: <9b44ab4891024f179455fbffde8506a7@git.apache.org> References: <9b44ab4891024f179455fbffde8506a7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [05/43] incubator-ignite git commit: ignite-656: skipStore is fixed for get and putAll operations X-Virus-Checked: Checked by ClamAV on apache.org ignite-656: skipStore is fixed for get and putAll operations Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/53345b6b Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/53345b6b Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/53345b6b Branch: refs/heads/ignite-sprint-4 Commit: 53345b6ba3e30e6cb2df30d87c0ece4bbdacc77c Parents: e914bc8 Author: Denis Magda Authored: Mon Apr 13 16:09:39 2015 +0300 Committer: Denis Magda Committed: Mon Apr 13 16:09:39 2015 +0300 ---------------------------------------------------------------------- .../GridDistributedCacheAdapter.java | 2 + .../dht/GridPartitionedGetFuture.java | 3 +- .../dht/atomic/GridDhtAtomicCache.java | 2 +- .../distributed/near/GridNearGetFuture.java | 3 +- .../distributed/near/GridNearGetRequest.java | 7 +- .../cache/GridCacheAbstractFullApiSelfTest.java | 83 +++++++++++++++++++- 6 files changed, 95 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53345b6b/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..b76dce8 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 @@ -291,6 +291,8 @@ public abstract class GridDistributedCacheAdapter extends GridCacheAdapter (DataStreamerImpl)ignite.dataStreamer(cacheName)) { ((DataStreamerImpl)dataLdr).maxRemapCount(0); + //dataLdr.skipStore(); //Pass skip store flag here (needed for removeAll operation) + dataLdr.receiver(DataStreamerCacheUpdaters.batched()); for (GridDhtLocalPartition locPart : dht.topology().currentLocalPartitions()) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53345b6b/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 da2105d..ec58075 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 @@ -372,7 +372,8 @@ public class GridPartitionedGetFuture extends GridCompoundIdentityFuture extends GridDhtCacheAdapter { //TODO: support skipStore for putAll if (keys.size() > 1 && // Several keys ... - writeThrough() && // and store is enabled ... + writeThrough() && !req.skipStore() && // and store is enabled ... !ctx.store().isLocal() && // and this is not local store ... !ctx.dr().receiveEnabled() // and no DR. ) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53345b6b/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 b1017d8..ece64a6 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 @@ -372,7 +372,8 @@ public final class GridNearGetFuture extends GridCompoundIdentityFuture(1000); + + for (int i = 0; i < 1000; i++) + keys.add("key_" + i); + + for (int i = 0; i < keys.size(); ++i) + cache.put(keys.get(i), i); + + for (String key : keys) { + assertNotNull(cacheSkipStore.get(key)); + assertNotNull(cache.get(key)); + assertTrue(map.containsKey(key)); + } + + for (String key : keys) { + cacheSkipStore.remove(key); + + assertNull(cacheSkipStore.get(key)); + assertNotNull(cache.get(key)); + assertTrue(map.containsKey(key)); + } + + for (String key : keys) { + cache.remove(key); + + assertNull(cacheSkipStore.get(key)); + assertNull(cache.get(key)); + assertFalse(map.containsKey(key)); + } + + assertFalse(cacheSkipStore.iterator().hasNext()); + assertTrue(map.size() == 0); + + // putAll/removeAll from multiple nodes. + + Map data = new HashMap<>(); + + for (int i = 0; i < keys.size(); i++) + data.put(keys.get(i), i); + + cacheSkipStore.putAll(data); + + for (String key : keys) { + assertNotNull(cacheSkipStore.get(key)); + assertNotNull(cache.get(key)); + assertFalse(map.containsKey(key)); + } + + cache.putAll(data); + + for (String key : keys) { + assertNotNull(cacheSkipStore.get(key)); + assertNotNull(cache.get(key)); + assertTrue(map.containsKey(key)); + } + + cacheSkipStore.removeAll(); + + for (String key : keys) { + assertNull(cacheSkipStore.get(key)); + assertNotNull(cache.get(key)); + assertTrue(map.containsKey(key)); + } + + cache.removeAll(); + + for (String key : keys) { + assertNull(cacheSkipStore.get(key)); + assertNull(cache.get(key)); + assertFalse(map.containsKey(key)); + } + + // Final checks + String newKey = "New key"; assertFalse(map.containsKey(newKey)); @@ -4311,7 +4392,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract Cache.Entry entry = it.next(); - String rmvKey = entry.getKey(); + String rmvKey = entry.getKey(); assertTrue(map.containsKey(rmvKey));