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 5F6DC106DB for ; Mon, 27 Apr 2015 11:10:52 +0000 (UTC) Received: (qmail 18457 invoked by uid 500); 27 Apr 2015 11:10:52 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 18390 invoked by uid 500); 27 Apr 2015 11:10:52 -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 18238 invoked by uid 99); 27 Apr 2015 11:10:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2015 11:10:52 +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.191.145.13] (HELO mx1-us-west.apache.org) (54.191.145.13) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2015 11:10:45 +0000 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 A88F7273A3 for ; Mon, 27 Apr 2015 11:10:23 +0000 (UTC) Received: (qmail 16220 invoked by uid 99); 27 Apr 2015 11:10:23 -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; Mon, 27 Apr 2015 11:10:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 52B1DE30F2; Mon, 27 Apr 2015 11:10:23 +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: Mon, 27 Apr 2015 11:10:28 -0000 Message-Id: <29a930f322524b2fbf6f8fd136baaa11@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [06/50] incubator-ignite git commit: ignite-656: fixing ctx.skipStore() X-Virus-Checked: Checked by ClamAV on apache.org ignite-656: fixing ctx.skipStore() Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/00ccfc4d Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/00ccfc4d Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/00ccfc4d Branch: refs/heads/ignite-695 Commit: 00ccfc4db07e97a2c0573f79b8cbddd11dbe9267 Parents: 637a190 Author: Denis Magda Authored: Mon Apr 20 17:44:10 2015 +0300 Committer: Denis Magda Committed: Mon Apr 20 17:44:10 2015 +0300 ---------------------------------------------------------------------- .../distributed/dht/GridDhtLockFuture.java | 10 +++++++-- .../dht/GridDhtTransactionalCacheAdapter.java | 15 +++++++++---- .../distributed/dht/GridDhtTxLocalAdapter.java | 9 +++++--- .../dht/atomic/GridDhtAtomicCache.java | 9 +++++--- .../dht/atomic/GridNearAtomicUpdateFuture.java | 12 +++++++--- .../dht/colocated/GridDhtColocatedCache.java | 23 ++++++++++++++------ .../colocated/GridDhtColocatedLockFuture.java | 13 ++++++++--- .../distributed/near/GridNearLockFuture.java | 10 +++++++-- .../near/GridNearTransactionalCache.java | 5 ++++- .../cache/distributed/near/GridNearTxLocal.java | 7 ++++-- 10 files changed, 83 insertions(+), 30 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00ccfc4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java index f247c0c..e24653a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java @@ -132,6 +132,9 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture extends GridCompoundIdentityFuture cctx, @@ -157,7 +161,8 @@ public final class GridDhtLockFuture extends GridCompoundIdentityFuture extends GridCompoundIdentityFuture extends GridCompoundIdentityFuture it = dhtMapping.listIterator(); it.hasNext();) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00ccfc4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java index 092dcd0..87026f3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java @@ -561,6 +561,8 @@ public abstract class GridDhtTransactionalCacheAdapter extends GridDhtCach boolean retval, TransactionIsolation isolation, long accessTtl) { + CacheOperationContext opCtx = ctx.operationContextPerCall(); + return lockAllAsyncInternal( keys, timeout, @@ -570,7 +572,8 @@ public abstract class GridDhtTransactionalCacheAdapter extends GridDhtCach retval, isolation, accessTtl, - CU.empty0()); + CU.empty0(), + opCtx != null && opCtx.skipStore()); } /** @@ -585,6 +588,7 @@ public abstract class GridDhtTransactionalCacheAdapter extends GridDhtCach * @param isolation Transaction isolation. * @param accessTtl TTL for read operation. * @param filter Optional filter. + * @param skipStore Skip store flag. * @return Lock future. */ public GridDhtFuture lockAllAsyncInternal(@Nullable Collection keys, @@ -595,7 +599,8 @@ public abstract class GridDhtTransactionalCacheAdapter extends GridDhtCach boolean retval, TransactionIsolation isolation, long accessTtl, - CacheEntryPredicate[] filter) { + CacheEntryPredicate[] filter, + boolean skipStore) { if (keys == null || keys.isEmpty()) return new GridDhtFinishedFuture<>(true); @@ -615,7 +620,8 @@ public abstract class GridDhtTransactionalCacheAdapter extends GridDhtCach tx, tx.threadId(), accessTtl, - filter); + filter, + skipStore); for (KeyCacheObject key : keys) { try { @@ -731,7 +737,8 @@ public abstract class GridDhtTransactionalCacheAdapter extends GridDhtCach tx, req.threadId(), req.accessTtl(), - filter); + filter, + req.skipStore()); // Add before mapping. if (!ctx.mvcc().addFuture(fut)) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00ccfc4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java index 1bfc3d1..79f1f96 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java @@ -625,7 +625,7 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter { if (log.isDebugEnabled()) log.debug("Lock keys: " + passedKeys); - return obtainLockAsync(cacheCtx, ret, passedKeys, read, needRetVal, skipped, accessTtl, null); + return obtainLockAsync(cacheCtx, ret, passedKeys, read, needRetVal, skipped, accessTtl, null, skipStore); } catch (IgniteCheckedException e) { setRollbackOnly(); @@ -642,6 +642,7 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter { * @param skipped Skipped keys. * @param accessTtl TTL for read operation. * @param filter Entry write filter. + * @param skipStore Skip store flag. * @return Future for lock acquisition. */ private IgniteInternalFuture obtainLockAsync( @@ -652,7 +653,8 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter { final boolean needRetVal, final Set skipped, final long accessTtl, - @Nullable final CacheEntryPredicate[] filter) { + @Nullable final CacheEntryPredicate[] filter, + boolean skipStore) { if (log.isDebugEnabled()) log.debug("Before acquiring transaction lock on keys [passedKeys=" + passedKeys + ", skipped=" + skipped + ']'); @@ -670,7 +672,8 @@ public abstract class GridDhtTxLocalAdapter extends IgniteTxLocalAdapter { needRetVal, isolation, accessTtl, - CU.empty0()); + CU.empty0(), + skipStore); return new GridEmbeddedFuture<>( fut, http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00ccfc4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java index 08a1622..dfde9f2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java @@ -762,7 +762,8 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { opCtx != null ? opCtx.expiry() : null, filter, subjId, - taskNameHash); + taskNameHash, + opCtx != null && opCtx.skipStore()); return asyncOp(new CO>() { @Override public IgniteInternalFuture apply() { @@ -822,7 +823,8 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { (filter != null && opCtx != null) ? opCtx.expiry() : null, filter, subjId, - taskNameHash); + taskNameHash, + opCtx != null && opCtx.skipStore()); if (statsEnabled) updateFut.listen(new UpdateRemoveTimeStatClosure<>(metrics0(), start)); @@ -2258,7 +2260,8 @@ public class GridDhtAtomicCache extends GridDhtCacheAdapter { req.expiry(), req.filter(), req.subjectId(), - req.taskNameHash()); + req.taskNameHash(), + req.skipStore()); updateFut.map(true); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00ccfc4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java index ba25e46..0aa794b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java @@ -136,6 +136,9 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter /** Task name hash. */ private final int taskNameHash; + /** Skip store flag. */ + private final boolean skipStore; + /** * @param cctx Cache context. * @param cache Cache instance. @@ -152,6 +155,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter * @param filter Entry filter. * @param subjId Subject ID. * @param taskNameHash Task name hash code. + * @param skipStore Skip store flag. */ public GridNearAtomicUpdateFuture( GridCacheContext cctx, @@ -168,7 +172,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter @Nullable ExpiryPolicy expiryPlc, final CacheEntryPredicate[] filter, UUID subjId, - int taskNameHash + int taskNameHash, + boolean skipStore ) { this.rawRetval = rawRetval; @@ -191,6 +196,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter this.filter = filter; this.subjId = subjId; this.taskNameHash = taskNameHash; + this.skipStore = skipStore; if (log == null) log = U.logger(cctx.kernalContext(), logRef, GridFutureAdapter.class); @@ -572,7 +578,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter filter, subjId, taskNameHash, - cctx.skipStore()); + skipStore); req.addUpdateEntry(cacheKey, val, @@ -695,7 +701,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter filter, subjId, taskNameHash, - cctx.skipStore()); + skipStore); pendingMappings.put(nodeId, mapped); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00ccfc4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java index 00443bc..4203934 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java @@ -369,7 +369,8 @@ public class GridDhtColocatedCache extends GridDhtTransactionalCacheAdapte retval, timeout, accessTtl, - CU.empty0()); + CU.empty0(), + txx != null && txx.storeEnabled()); // Future will be added to mvcc only if it was mapped to remote nodes. fut.map(); @@ -593,6 +594,7 @@ public class GridDhtColocatedCache extends GridDhtTransactionalCacheAdapte * @param timeout Lock timeout. * @param accessTtl TTL for read operation. * @param filter filter Optional filter. + * @param skipStore Skip store flag. * @return Lock future. */ IgniteInternalFuture lockAllAsync( @@ -606,7 +608,8 @@ public class GridDhtColocatedCache extends GridDhtTransactionalCacheAdapte final boolean retval, final long timeout, final long accessTtl, - @Nullable final CacheEntryPredicate[] filter + @Nullable final CacheEntryPredicate[] filter, + final boolean skipStore ) { assert keys != null; @@ -628,7 +631,8 @@ public class GridDhtColocatedCache extends GridDhtTransactionalCacheAdapte retval, timeout, accessTtl, - filter); + filter, + skipStore); } catch (IgniteCheckedException e) { return new GridFinishedFuture<>(e); @@ -651,7 +655,8 @@ public class GridDhtColocatedCache extends GridDhtTransactionalCacheAdapte retval, timeout, accessTtl, - filter); + filter, + skipStore); } } ); @@ -669,6 +674,7 @@ public class GridDhtColocatedCache extends GridDhtTransactionalCacheAdapte * @param timeout Lock timeout. * @param accessTtl TTL for read operation. * @param filter filter Optional filter. + * @param skipStore Skip store flag. * @return Lock future. */ private IgniteInternalFuture lockAllAsync0( @@ -682,7 +688,8 @@ public class GridDhtColocatedCache extends GridDhtTransactionalCacheAdapte boolean retval, final long timeout, final long accessTtl, - @Nullable final CacheEntryPredicate[] filter) { + @Nullable final CacheEntryPredicate[] filter, + boolean skipStore) { int cnt = keys.size(); if (tx == null) { @@ -697,7 +704,8 @@ public class GridDhtColocatedCache extends GridDhtTransactionalCacheAdapte tx, threadId, accessTtl, - filter); + filter, + skipStore); // Add before mapping. if (!ctx.mvcc().addFuture(fut)) @@ -763,7 +771,8 @@ public class GridDhtColocatedCache extends GridDhtTransactionalCacheAdapte keys, tx.implicit(), txRead, - accessTtl); + accessTtl, + skipStore); return new GridDhtEmbeddedFuture<>( new C2() { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00ccfc4d/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 bb464d6..a949f0f 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 @@ -109,6 +109,9 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentity /** TTL for read operation. */ private long accessTtl; + /** Skip store flag. */ + private final boolean skipStore; + /** * @param cctx Registry. * @param keys Keys to lock. @@ -118,6 +121,7 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentity * @param timeout Lock acquisition timeout. * @param accessTtl TTL for read operation. * @param filter Filter. + * @param skipStore */ public GridDhtColocatedLockFuture( GridCacheContext cctx, @@ -127,7 +131,8 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentity boolean retval, long timeout, long accessTtl, - CacheEntryPredicate[] filter) { + CacheEntryPredicate[] filter, + boolean skipStore) { super(cctx.kernalContext(), CU.boolReducer()); assert keys != null; @@ -140,6 +145,7 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentity this.timeout = timeout; this.accessTtl = accessTtl; this.filter = filter; + this.skipStore = skipStore; ignoreInterrupts(true); @@ -733,7 +739,7 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentity inTx() ? tx.subjectId() : null, inTx() ? tx.taskNameHash() : 0, read ? accessTtl : -1L, - cctx.skipStore()); + skipStore); mapping.request(req); } @@ -899,7 +905,8 @@ public final class GridDhtColocatedLockFuture extends GridCompoundIdentity retval, timeout, accessTtl, - filter); + filter, + skipStore); // Add new future. add(new GridEmbeddedFuture<>( http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00ccfc4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java index 01ce307..6b03fd2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java @@ -120,6 +120,9 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture extends GridCompoundIdentityFuture cctx, @@ -138,7 +142,8 @@ public final class GridNearLockFuture extends GridCompoundIdentityFuture extends GridCompoundIdentityFuture extends GridCompoundIdentityFuture extends GridNearCacheAdapter TransactionIsolation isolation, long accessTtl ) { + CacheOperationContext opCtx = ctx.operationContextPerCall(); + GridNearLockFuture fut = new GridNearLockFuture<>(ctx, keys, (GridNearTxLocal)tx, @@ -428,7 +430,8 @@ public class GridNearTransactionalCache extends GridNearCacheAdapter retval, timeout, accessTtl, - CU.empty0()); + CU.empty0(), + opCtx != null && opCtx.skipStore()); if (!ctx.mvcc().addFuture(fut)) throw new IllegalStateException("Duplicate future ID: " + fut); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/00ccfc4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java index 1b2d204..1dc459e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java @@ -1063,13 +1063,15 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter { * @param read Read flag. * @param accessTtl Access ttl. * @param Key type. + * @param skipStore Skip store flag. * @return Future with respond. */ public IgniteInternalFuture lockAllAsync(GridCacheContext cacheCtx, final Collection keys, boolean implicit, boolean read, - long accessTtl) { + long accessTtl, + boolean skipStore) { assert pessimistic(); try { @@ -1097,7 +1099,8 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter { /*retval*/false, isolation, accessTtl, - CU.empty0()); + CU.empty0(), + skipStore); return new GridEmbeddedFuture<>( fut,