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 6F4B118A06 for ; Wed, 20 Apr 2016 07:12:08 +0000 (UTC) Received: (qmail 71605 invoked by uid 500); 20 Apr 2016 07:12:07 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 71483 invoked by uid 500); 20 Apr 2016 07:12:07 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 71040 invoked by uid 99); 20 Apr 2016 07:12:07 -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; Wed, 20 Apr 2016 07:12:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 36134EAB4B; Wed, 20 Apr 2016 07:12:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Wed, 20 Apr 2016 07:12:22 -0000 Message-Id: <46575b0329474ec69b35b293a1ff1d43@git.apache.org> In-Reply-To: <654812b3ebd84403b663dfcdb1d3d270@git.apache.org> References: <654812b3ebd84403b663dfcdb1d3d270@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [17/26] ignite git commit: Another attempt to remove "remapKeys" collection. Another attempt to remove "remapKeys" collection. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3f2450d2 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3f2450d2 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3f2450d2 Branch: refs/heads/ignite-2523-1 Commit: 3f2450d27ba23fd5a5cfddfa06e3ff47cf46326a Parents: 1b95311 Author: vozerov-gridgain Authored: Mon Apr 18 15:52:02 2016 +0300 Committer: vozerov-gridgain Committed: Mon Apr 18 15:52:02 2016 +0300 ---------------------------------------------------------------------- .../GridNearAtomicSingleUpdateFuture.java | 27 +++----------------- 1 file changed, 4 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/3f2450d2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java index e93f240..7a95640 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java @@ -42,7 +42,6 @@ import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.S; -import org.apache.ignite.internal.util.typedef.internal.U; import org.jetbrains.annotations.Nullable; import javax.cache.expiry.ExpiryPolicy; @@ -70,9 +69,6 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda /** Not null is operation is mapped to single node. */ private GridNearAtomicUpdateRequest req; - /** Keys to remap. */ - private Collection remapKeys; - /** * @param cctx Cache context. * @param cache Cache instance. @@ -215,12 +211,9 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda this.req = null; - if (res.remapKeys() != null) { - if (remapKeys == null) - remapKeys = U.newHashSet(res.remapKeys().size()); - - remapKeys.addAll(res.remapKeys()); + boolean remapKey = !F.isEmpty(res.remapKeys()); + if (remapKey) { if (mapErrTopVer == null || mapErrTopVer.compareTo(req.topologyVersion()) < 0) mapErrTopVer = req.topologyVersion(); } @@ -259,7 +252,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda } } - if (remapKeys != null) { + if (remapKey) { assert mapErrTopVer != null; remapTopVer = cctx.shared().exchange().topologyVersion(); @@ -283,14 +276,6 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda new AffinityTopologyVersion(cause.topologyVersion().topologyVersion() + 1); err = null; - - Collection failedKeys = cause.failedKeys(); - - remapKeys = new ArrayList<>(failedKeys.size()); - - for (Object key : failedKeys) - remapKeys.add(cctx.toCacheKeyObject(key)); - updVer = null; } } @@ -332,8 +317,6 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda } if (topLocked) { - assert !F.isEmpty(remapKeys) : remapKeys; - CachePartialUpdateCheckedException e = new CachePartialUpdateCheckedException("Failed to update keys (retry update if possible)."); @@ -342,7 +325,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda cause.retryReadyFuture(cctx.affinity().affinityReadyFuture(remapTopVer)); - e.add(remapKeys, cause); + e.add(Collections.singleton(cctx.toCacheKeyObject(key)), cause); onDone(e); @@ -543,8 +526,6 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda resCnt = 0; req = singleReq0; - - this.remapKeys = null; } } catch (Exception e) {