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 DE5E818E19 for ; Fri, 29 May 2015 14:41:27 +0000 (UTC) Received: (qmail 56000 invoked by uid 500); 29 May 2015 14:41:27 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 55968 invoked by uid 500); 29 May 2015 14:41: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 55959 invoked by uid 99); 29 May 2015 14:41:27 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 May 2015 14:41:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 5D3D1182399 for ; Fri, 29 May 2015 14:41:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.771 X-Spam-Level: * X-Spam-Status: No, score=1.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id xVsuGgo-GFnw for ; Fri, 29 May 2015 14:41:23 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 30D8824CE6 for ; Fri, 29 May 2015 14:41:23 +0000 (UTC) Received: (qmail 55821 invoked by uid 99); 29 May 2015 14:41:22 -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; Fri, 29 May 2015 14:41:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CF864E00D5; Fri, 29 May 2015 14:41:22 +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 Message-Id: <3714a68ce1d84acc820da348c218fcfb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-ignite git commit: # ignite-943 fixed client futures remap Date: Fri, 29 May 2015 14:41:22 +0000 (UTC) Repository: incubator-ignite Updated Branches: refs/heads/ignite-943 b3d8e1e13 -> d10fe3e90 # ignite-943 fixed client futures remap Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d10fe3e9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d10fe3e9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d10fe3e9 Branch: refs/heads/ignite-943 Commit: d10fe3e9013bc9ecd27823ff00443983b7c066c2 Parents: b3d8e1e Author: sboikov Authored: Fri May 29 17:29:28 2015 +0300 Committer: sboikov Committed: Fri May 29 17:29:28 2015 +0300 ---------------------------------------------------------------------- .../dht/colocated/GridDhtColocatedLockFuture.java | 18 ++++++++++++------ .../near/GridNearOptimisticTxPrepareFuture.java | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d10fe3e9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java index 5a4c91d..c784948 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java @@ -549,7 +549,7 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture } // Must get topology snapshot and map on that version. - mapOnTopology(false); + mapOnTopology(false, null); } /** @@ -557,8 +557,9 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture * will asynchronously wait for it's completeness and then try again. * * @param remap Remap flag. + * @param c Optional closure to run after map. */ - private void mapOnTopology(final boolean remap) { + private void mapOnTopology(final boolean remap, @Nullable final Runnable c) { // We must acquire topology snapshot from the topology version future. cctx.topology().readLock(); @@ -597,12 +598,15 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture map(keys, remap); + if (c != null) + c.run(); + markInitialized(); } else { fut.listen(new CI1>() { @Override public void apply(IgniteInternalFuture t) { - mapOnTopology(remap); + mapOnTopology(remap, c); } }); } @@ -1366,9 +1370,11 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentityFuture for (KeyCacheObject key : GridDhtColocatedLockFuture.this.keys) cctx.mvcc().removeExplicitLock(threadId, key, lockVer); - mapOnTopology(true); - - onDone(true); + mapOnTopology(true, new Runnable() { + @Override public void run() { + onDone(true); + } + }); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d10fe3e9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java index 0a92112..44b7997 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java @@ -226,13 +226,14 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearTxPrepareFutureAd return; } - prepareOnTopology(false); + prepareOnTopology(false, null); } /** * @param remap Remap flag. + * @param c Optional closure to run after map. */ - private void prepareOnTopology(final boolean remap) { + private void prepareOnTopology(final boolean remap, @Nullable final Runnable c) { GridDhtTopologyFuture topFut = topologyReadLock(); try { @@ -271,13 +272,16 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearTxPrepareFutureAd tx.topologyVersion(topFut.topologyVersion()); prepare0(remap); + + if (c != null) + c.run(); } else { topFut.listen(new CI1>() { @Override public void apply(IgniteInternalFuture t) { cctx.kernalContext().closure().runLocalSafe(new GridPlainRunnable() { @Override public void run() { - prepareOnTopology(remap); + prepareOnTopology(remap, c); } }); } @@ -796,9 +800,11 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearTxPrepareFutureAd * */ private void remap() { - prepareOnTopology(true); - - onDone(tx); + prepareOnTopology(true, new Runnable() { + @Override public void run() { + onDone(tx); + } + }); } /** {@inheritDoc} */