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 B0AA8173E2 for ; Tue, 9 Jun 2015 09:21:47 +0000 (UTC) Received: (qmail 16057 invoked by uid 500); 9 Jun 2015 09:21:47 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 15989 invoked by uid 500); 9 Jun 2015 09:21:47 -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 15973 invoked by uid 99); 9 Jun 2015 09:21:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jun 2015 09:21:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 09 Jun 2015 09:19:30 +0000 Received: (qmail 12493 invoked by uid 99); 9 Jun 2015 09:21:13 -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; Tue, 09 Jun 2015 09:21:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 94329DFF16; Tue, 9 Jun 2015 09:21:13 +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: Tue, 09 Jun 2015 09:21:55 -0000 Message-Id: <64bbc35679f64a93bae2210d298d19a2@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [44/50] incubator-ignite git commit: # ignite-sprint-5 minor optimization in force keys future X-Virus-Checked: Checked by ClamAV on apache.org # ignite-sprint-5 minor optimization in force keys future Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0fa2853e Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0fa2853e Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0fa2853e Branch: refs/heads/ignite-961 Commit: 0fa2853e060fee7c9c8c8484be412e91d30c52da Parents: ff7827e Author: sboikov Authored: Mon Jun 8 16:31:31 2015 +0300 Committer: sboikov Committed: Mon Jun 8 16:31:31 2015 +0300 ---------------------------------------------------------------------- .../dht/preloader/GridDhtForceKeysFuture.java | 40 +++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0fa2853e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java index 9637fd1..1d57ef7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysFuture.java @@ -208,21 +208,21 @@ public final class GridDhtForceKeysFuture extends GridCompoundFuture keys, Collection exc) { - Map> mappings = new HashMap<>(); - - ClusterNode loc = cctx.localNode(); - - int curTopVer = topCntr.get(); + Map> mappings = null; for (KeyCacheObject key : keys) - map(key, mappings, exc); + mappings = map(key, mappings, exc); if (isDone()) return false; boolean ret = false; - if (!mappings.isEmpty()) { + if (mappings != null) { + ClusterNode loc = cctx.localNode(); + + int curTopVer = topCntr.get(); + preloader.addFuture(this); trackable = true; @@ -275,22 +275,27 @@ public final class GridDhtForceKeysFuture extends GridCompoundFuture> mappings, Collection exc) { + private Map> map(KeyCacheObject key, + @Nullable Map> mappings, + Collection exc) + { ClusterNode loc = cctx.localNode(); - int part = cctx.affinity().partition(key); - GridCacheEntryEx e = cctx.dht().peekEx(key); try { if (e != null && !e.isNewLocked()) { - if (log.isDebugEnabled()) + if (log.isDebugEnabled()) { + int part = cctx.affinity().partition(key); + log.debug("Will not rebalance key (entry is not new) [cacheName=" + cctx.name() + ", key=" + key + ", part=" + part + ", locId=" + cctx.nodeId() + ']'); + } // Key has been rebalanced or retrieved already. - return; + return mappings; } } catch (GridCacheEntryRemovedException ignore) { @@ -299,6 +304,8 @@ public final class GridDhtForceKeysFuture extends GridCompoundFuture