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 93F28173D0 for ; Tue, 21 Apr 2015 16:20:31 +0000 (UTC) Received: (qmail 23305 invoked by uid 500); 21 Apr 2015 16:20:31 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 23238 invoked by uid 500); 21 Apr 2015 16:20:31 -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 23222 invoked by uid 99); 21 Apr 2015 16:20:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2015 16:20:31 +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; Tue, 21 Apr 2015 16:20:26 +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 0528E453F3 for ; Tue, 21 Apr 2015 16:15:57 +0000 (UTC) Received: (qmail 5385 invoked by uid 99); 21 Apr 2015 16:15: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; Tue, 21 Apr 2015 16:15:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7A894E0922; Tue, 21 Apr 2015 16:15:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sevdokimov@apache.org To: commits@ignite.incubator.apache.org Date: Tue, 21 Apr 2015 16:16:05 -0000 Message-Id: <626d55d19ea54e388725aa1a18359ba8@git.apache.org> In-Reply-To: <92f50504c376430fb581e1cc67be7d06@git.apache.org> References: <92f50504c376430fb581e1cc67be7d06@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [10/50] incubator-ignite git commit: #ignite-758: Operation context is null by default. X-Virus-Checked: Checked by ClamAV on apache.org #ignite-758: Operation context is null by default. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b6bf81ad Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b6bf81ad Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b6bf81ad Branch: refs/heads/ignite-478 Commit: b6bf81add680b439ee3623d3a3d1252d27e16783 Parents: 6224b7e Author: ivasilinets Authored: Fri Apr 17 17:10:59 2015 +0300 Committer: ivasilinets Committed: Fri Apr 17 17:10:59 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/GridCacheProxyImpl.java | 24 +++++++++++--------- .../processors/cache/IgniteCacheProxy.java | 24 ++++++++++++++------ 2 files changed, 30 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b6bf81ad/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java index babb3ac..2294e8b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java @@ -82,7 +82,7 @@ public class GridCacheProxyImpl implements IgniteInternalCache, Exte this.ctx = ctx; this.delegate = delegate; - this.opCtx = opCtx == null ? new CacheOperationContext() : opCtx; + this.opCtx = opCtx; gate = ctx.gate(); @@ -118,7 +118,7 @@ public class GridCacheProxyImpl implements IgniteInternalCache, Exte CacheOperationContext prev = gate.enter(opCtx); try { - return opCtx.skipStore(); + return opCtx != null ? opCtx.skipStore() : false; } finally { gate.leave(prev); @@ -197,7 +197,8 @@ public class GridCacheProxyImpl implements IgniteInternalCache, Exte /** {@inheritDoc} */ @Override public GridCacheProxyImpl forSubjectId(UUID subjId) { - return new GridCacheProxyImpl<>(ctx, delegate, opCtx.forSubjectId(subjId)); + return new GridCacheProxyImpl<>(ctx, delegate, + opCtx != null ? opCtx.forSubjectId(subjId) : new CacheOperationContext(false, subjId, false, null)); } /** {@inheritDoc} */ @@ -205,10 +206,11 @@ public class GridCacheProxyImpl implements IgniteInternalCache, Exte CacheOperationContext prev = gate.enter(opCtx); try { - if (opCtx.skipStore() == skipStore) + if (opCtx != null && opCtx.skipStore() == skipStore) return this; - return new GridCacheProxyImpl<>(ctx, delegate, opCtx.setSkipStore(skipStore)); + return new GridCacheProxyImpl<>(ctx, delegate, + opCtx != null ? opCtx.setSkipStore(skipStore) : new CacheOperationContext(true, null, false, null)); } finally { gate.leave(prev); @@ -217,10 +219,11 @@ public class GridCacheProxyImpl implements IgniteInternalCache, Exte /** {@inheritDoc} */ @Override public GridCacheProxyImpl keepPortable() { - if (opCtx.isKeepPortable()) + if (opCtx != null && opCtx.isKeepPortable()) return (GridCacheProxyImpl)this; - return new GridCacheProxyImpl<>((GridCacheContext)ctx, (GridCacheAdapter)delegate, opCtx.keepPortable()); + return new GridCacheProxyImpl<>((GridCacheContext)ctx, (GridCacheAdapter)delegate, + opCtx != null ? opCtx.keepPortable() : new CacheOperationContext(false, null, true, null)); } /** {@inheritDoc} */ @@ -1502,7 +1505,7 @@ public class GridCacheProxyImpl implements IgniteInternalCache, Exte /** {@inheritDoc} */ @Nullable @Override public ExpiryPolicy expiry() { - return opCtx.expiry(); + return opCtx != null ? opCtx.expiry() : null; } /** {@inheritDoc} */ @@ -1510,9 +1513,8 @@ public class GridCacheProxyImpl implements IgniteInternalCache, Exte CacheOperationContext prev = gate.enter(opCtx); try { - CacheOperationContext prj0 = opCtx.withExpiryPolicy(plc); - - return new GridCacheProxyImpl<>(ctx, delegate, prj0); + return new GridCacheProxyImpl<>(ctx, delegate, + opCtx != null ? opCtx.withExpiryPolicy(plc) : new CacheOperationContext(false, null, false, plc)); } finally { gate.leave(prev); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b6bf81ad/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 128091f..9066cb8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -129,7 +129,7 @@ public class IgniteCacheProxy extends AsyncSupportAdapter extends AsyncSupportAdapter(ctx, delegate, prj0, isAsync(), lock); } @@ -347,10 +348,12 @@ public class IgniteCacheProxy extends AsyncSupportAdapter> qry; final CacheQueryFuture> fut; + boolean isKeepPortable = opCtx != null ? opCtx.isKeepPortable() : false; + if (filter instanceof ScanQuery) { IgniteBiPredicate p = ((ScanQuery)filter).getFilter(); - qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, opCtx.isKeepPortable()); + qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, isKeepPortable); if (grp != null) qry.projection(grp); @@ -360,7 +363,7 @@ public class IgniteCacheProxy extends AsyncSupportAdapter extends AsyncSupportAdapter extends AsyncSupportAdapter((GridCacheContext)ctx, (GridCacheAdapter)delegate, @@ -1468,7 +1475,10 @@ public class IgniteCacheProxy extends AsyncSupportAdapter(ctx, delegate,