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 566BE10324 for ; Mon, 19 Jan 2015 06:58:39 +0000 (UTC) Received: (qmail 84633 invoked by uid 500); 19 Jan 2015 06:58:41 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 84559 invoked by uid 500); 19 Jan 2015 06:58:41 -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 84541 invoked by uid 99); 19 Jan 2015 06:58:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jan 2015 06:58:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 19 Jan 2015 06:58:39 +0000 Received: (qmail 83327 invoked by uid 99); 19 Jan 2015 06:58:19 -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, 19 Jan 2015 06:58:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4D4A3E03FD; Mon, 19 Jan 2015 06:58:19 +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, 19 Jan 2015 06:58:19 -0000 Message-Id: <59a20bcfdbf14102bf375f2f072b9031@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/16] incubator-ignite git commit: # Fixed query with portables. X-Virus-Checked: Checked by ClamAV on apache.org Repository: incubator-ignite Updated Branches: refs/heads/ignite-42 5521dac5a -> 2bbf624ee # Fixed query with portables. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e4c2bc46 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e4c2bc46 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e4c2bc46 Branch: refs/heads/ignite-42 Commit: e4c2bc4662f69fdb05d8d99779ebdface45c7c60 Parents: 0d5ea99 Author: AKuznetsov Authored: Thu Jan 15 14:53:04 2015 +0700 Committer: AKuznetsov Committed: Thu Jan 15 14:53:04 2015 +0700 ---------------------------------------------------------------------- .../grid/kernal/visor/query/VisorQueryTask.java | 53 ++++++++++++-------- 1 file changed, 32 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e4c2bc46/modules/core/src/main/java/org/gridgain/grid/kernal/visor/query/VisorQueryTask.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/visor/query/VisorQueryTask.java b/modules/core/src/main/java/org/gridgain/grid/kernal/visor/query/VisorQueryTask.java index 1efc054..225eb79 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/visor/query/VisorQueryTask.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/visor/query/VisorQueryTask.java @@ -129,6 +129,11 @@ public class VisorQueryTask extends VisorOneNodeTask fut, R next, Boolean accessed) { this.fut = fut; this.next = next; @@ -188,15 +193,19 @@ public class VisorQueryTask extends VisorOneNodeTask c = g.cachex(arg.cacheName()); if (c == null) - return new IgniteBiTuple<>(new IgniteCheckedException("Cache not found: " + escapeName(arg.cacheName())), null); + return new IgniteBiTuple<>(new IgniteCheckedException("Cache not found: " + + escapeName(arg.cacheName())), null); + + GridCacheProjection cp = c.keepPortable(); if (scan) { - GridCacheQueryFuture> fut = c.queries().createScanQuery(null) + GridCacheQueryFuture> fut = cp.queries().createScanQuery(null) .pageSize(arg.pageSize()) .projection(g.forNodeIds(arg.proj())) .execute(); @@ -221,7 +230,7 @@ public class VisorQueryTask extends VisorOneNodeTask> fut = ((GridCacheQueriesEx)c.queries()) + GridCacheQueryFuture> fut = ((GridCacheQueriesEx)cp.queries()) .createSqlFieldsQuery(arg.queryTxt(), true) .pageSize(arg.pageSize()) .projection(g.forNodeIds(arg.proj())) @@ -245,7 +254,8 @@ public class VisorQueryTask extends VisorOneNodeTask, List> rows = VisorQueryUtils.fetchSqlQueryRows(fut, firstRow, arg.pageSize()); + IgniteBiTuple, List> rows = + VisorQueryUtils.fetchSqlQueryRows(fut, firstRow, arg.pageSize()); long fetchDuration = U.currentTimeMillis() - start; @@ -271,24 +281,25 @@ public class VisorQueryTask extends VisorOneNodeTask storage = g.nodeLocalMap(); - - VisorFutureResultSetHolder t = storage.get(id); - - if (t != null) { - // If future was accessed since last scheduling, set access flag to false and reschedule. - if (t.accessed()) { - t.accessed(false); - - scheduleResultSetHolderRemoval(id); + ((GridKernal)g).context().timeout() + .addTimeoutObject(new GridTimeoutObjectAdapter(VisorQueryUtils.RMV_DELAY) { + @Override public void onTimeout() { + ClusterNodeLocalMap storage = g.nodeLocalMap(); + + VisorFutureResultSetHolder t = storage.get(id); + + if (t != null) { + // If future was accessed since last scheduling, set access flag to false and reschedule. + if (t.accessed()) { + t.accessed(false); + + scheduleResultSetHolderRemoval(id); + } + else + storage.remove(id); // Remove stored future otherwise. } - else - storage.remove(id); // Remove stored future otherwise. } - } - }); + }); } /** {@inheritDoc} */