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 A1DF417584 for ; Tue, 21 Apr 2015 16:44:07 +0000 (UTC) Received: (qmail 21190 invoked by uid 500); 21 Apr 2015 16:44:07 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 21162 invoked by uid 500); 21 Apr 2015 16:44:07 -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 21153 invoked by uid 99); 21 Apr 2015 16:44:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2015 16:44:07 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of root@apache.org designates 54.76.25.247 as permitted sender) Received: from [54.76.25.247] (HELO mx1-eu-west.apache.org) (54.76.25.247) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2015 16:43:41 +0000 Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id CA5A225F30 for ; Tue, 21 Apr 2015 16:43:37 +0000 (UTC) Received: (qmail 13125 invoked by uid 99); 21 Apr 2015 16:42:21 -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:42:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 75201E0D64; Tue, 21 Apr 2015 16:42:21 +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:42:29 -0000 Message-Id: <0698acdd009f4c1eb47aa2fb250a2768@git.apache.org> In-Reply-To: <9852c3a857a94ecea961ae15e986a0f0@git.apache.org> References: <9852c3a857a94ecea961ae15e986a0f0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/50] incubator-ignite git commit: #ignite-758: add test for keep portable iterator. X-Virus-Checked: Checked by ClamAV on apache.org #ignite-758: add test for keep portable iterator. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6224b7ef Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6224b7ef Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6224b7ef Branch: refs/heads/ignite-709 Commit: 6224b7efd5b9f6ec50b4ce64b8ff7a3849e1fe04 Parents: a64810a Author: ivasilinets Authored: Fri Apr 17 16:57:19 2015 +0300 Committer: ivasilinets Committed: Fri Apr 17 16:57:19 2015 +0300 ---------------------------------------------------------------------- .../internal/processors/cache/GridCacheAdapter.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6224b7ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index 694f3d8..9bd5653 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -3670,12 +3670,13 @@ public abstract class GridCacheAdapter implements IgniteInternalCache> localIteratorHonorExpirePolicy() { + private Iterator> localIteratorHonorExpirePolicy(final CacheOperationContext opCtx) { return F.iterator(iterator(), new IgniteClosure, Cache.Entry>() { - private IgniteCacheExpiryPolicy expiryPlc = ctx.cache().expiryPolicy(ctx.expiry()); + private IgniteCacheExpiryPolicy expiryPlc = ctx.cache().expiryPolicy(opCtx.expiry()); @Override public Cache.Entry apply(Cache.Entry lazyEntry) { + CacheOperationContext prev = ctx.gate().enter(opCtx); try { V val = localPeek(lazyEntry.getKey(), CachePeekModes.ONHEAP_ONLY, expiryPlc); @@ -3684,6 +3685,9 @@ public abstract class GridCacheAdapter implements IgniteInternalCache implements IgniteInternalCache> igniteIterator() { GridCacheContext ctx0 = ctx.isNear() ? ctx.near().dht().context() : ctx; - if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1) - return localIteratorHonorExpirePolicy(); - final CacheOperationContext opCtx = ctx.operationContextPerCall(); - CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, false) + if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1) + return localIteratorHonorExpirePolicy(opCtx); + + CacheQueryFuture> fut = ctx0.queries().createScanQuery(null, ctx.keepPortable()) .keepAll(false) .execute();