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 71924173DB for ; Thu, 18 Jun 2015 06:54:43 +0000 (UTC) Received: (qmail 19210 invoked by uid 500); 18 Jun 2015 06:54:43 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 19138 invoked by uid 500); 18 Jun 2015 06:54:43 -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 19122 invoked by uid 99); 18 Jun 2015 06:54:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2015 06:54:43 +0000 X-ASF-Spam-Status: No, hits=-2000.4 required=5.0 tests=ALL_TRUSTED,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; Thu, 18 Jun 2015 06:52:29 +0000 Received: (qmail 17968 invoked by uid 99); 18 Jun 2015 06:54:09 -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; Thu, 18 Jun 2015 06:54:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0432CE1801; Thu, 18 Jun 2015 06:54:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergi@apache.org To: commits@ignite.incubator.apache.org Date: Thu, 18 Jun 2015 06:54:32 -0000 Message-Id: In-Reply-To: <89e53cb20a514306b8727a985f46f6c1@git.apache.org> References: <89e53cb20a514306b8727a985f46f6c1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [25/50] incubator-ignite git commit: ignite-484-1 - compilation X-Virus-Checked: Checked by ClamAV on apache.org ignite-484-1 - compilation Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d340fe72 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d340fe72 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d340fe72 Branch: refs/heads/ignite-sprint-6 Commit: d340fe72a99deab268dc019f6eaf474702f408b8 Parents: 51bf4b1 Author: S.Vladykin Authored: Thu Jun 11 10:04:22 2015 +0300 Committer: S.Vladykin Committed: Thu Jun 11 10:04:22 2015 +0300 ---------------------------------------------------------------------- .../h2/twostep/GridReduceQueryExecutor.java | 26 +++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d340fe72/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java index 3d2ae46..343a439 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java @@ -18,7 +18,6 @@ package org.apache.ignite.internal.processors.query.h2.twostep; import org.apache.ignite.*; -import org.apache.ignite.cache.query.*; import org.apache.ignite.cluster.*; import org.apache.ignite.events.*; import org.apache.ignite.internal.*; @@ -38,7 +37,7 @@ import org.apache.ignite.marshaller.*; import org.apache.ignite.plugin.extensions.communication.*; import org.h2.command.*; import org.h2.command.ddl.*; -import org.h2.command.dml.Query; +import org.h2.command.dml.*; import org.h2.engine.*; import org.h2.expression.*; import org.h2.index.*; @@ -395,9 +394,10 @@ public class GridReduceQueryExecutor { /** * @param cctx Cache context. * @param qry Query. + * @param keepPortable Keep portable. * @return Cursor. */ - public QueryCursor> query(GridCacheContext cctx, GridCacheTwoStepQuery qry, boolean keepPortable) { + public Iterator> query(GridCacheContext cctx, GridCacheTwoStepQuery qry, boolean keepPortable) { for (;;) { long qryReqId = reqIdGen.incrementAndGet(); @@ -501,7 +501,6 @@ public class GridReduceQueryExecutor { retry = true; // If remote node asks us to retry then we have outdated full partition map. - // TODO is this correct way to wait for a new map?? h2.awaitForReadyTopologyVersion((AffinityTopologyVersion)state); } } @@ -534,7 +533,7 @@ public class GridReduceQueryExecutor { continue; } - return new QueryCursorImpl<>(new GridQueryCacheObjectsIterator(new Iter(res), cctx, cctx.keepPortable())); + return new GridQueryCacheObjectsIterator(new Iter(res), cctx, keepPortable); } catch (IgniteCheckedException | RuntimeException e) { U.closeQuiet(r.conn); @@ -687,7 +686,22 @@ public class GridReduceQueryExecutor { } } - return new QueryCursorImpl<>(new GridQueryCacheObjectsIterator(new Iter(res), cctx, cctx.keepPortable())); + // Filter nodes where not all the replicated caches loaded. + for (String extraSpace : extraSpaces) { + GridCacheContext extraCctx = cacheContext(extraSpace); + + if (!extraCctx.isReplicated()) + continue; + + Set dataNodes = owningReplicatedDataNodes(extraCctx); + + for (Set partLoc : partLocs) { + partLoc.retainAll(dataNodes); + + if (partLoc.isEmpty()) + return null; // Retry. + } + } } // Collect the final partitions mapping.