Return-Path: X-Original-To: apmail-phoenix-commits-archive@minotaur.apache.org Delivered-To: apmail-phoenix-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 21B0D118D4 for ; Wed, 6 Aug 2014 16:42:13 +0000 (UTC) Received: (qmail 53979 invoked by uid 500); 6 Aug 2014 16:42:12 -0000 Delivered-To: apmail-phoenix-commits-archive@phoenix.apache.org Received: (qmail 53939 invoked by uid 500); 6 Aug 2014 16:42:12 -0000 Mailing-List: contact commits-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list commits@phoenix.apache.org Received: (qmail 53930 invoked by uid 99); 6 Aug 2014 16:42:12 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Aug 2014 16:42:12 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 53D7C9244A6; Wed, 6 Aug 2014 16:42:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jamestaylor@apache.org To: commits@phoenix.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: PHOENIX-1149 Index mutations should be committed as batches while building local index (Rajeshbabu) Date: Wed, 6 Aug 2014 16:42:12 +0000 (UTC) Repository: phoenix Updated Branches: refs/heads/4.0 8ad954bec -> 9cd0b494e PHOENIX-1149 Index mutations should be committed as batches while building local index (Rajeshbabu) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/9cd0b494 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/9cd0b494 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/9cd0b494 Branch: refs/heads/4.0 Commit: 9cd0b494ea8074d6d22b54a76f607fc796e4909b Parents: 8ad954b Author: James Taylor Authored: Wed Aug 6 09:45:40 2014 -0700 Committer: James Taylor Committed: Wed Aug 6 09:45:40 2014 -0700 ---------------------------------------------------------------------- .../main/java/org/apache/phoenix/compile/WhereOptimizer.java | 4 ++-- .../phoenix/coprocessor/UngroupedAggregateRegionObserver.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/9cd0b494/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java index 9c20610..b48838d 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java @@ -100,7 +100,7 @@ public class WhereOptimizer { Expression whereClause, Set extractNodes) { PName tenantId = context.getConnection().getTenantId(); PTable table = context.getResolver().getTables().get(0).getTable(); - if (whereClause == null && (tenantId == null || !table.isMultiTenant())) { + if (whereClause == null && (tenantId == null || !table.isMultiTenant()) && table.getViewIndexId() == null) { context.setScanRanges(ScanRanges.EVERYTHING); return whereClause; } @@ -116,7 +116,7 @@ public class WhereOptimizer { // becomes consistent. keySlots = whereClause.accept(visitor); - if (keySlots == null && (tenantId == null || !table.isMultiTenant())) { + if (keySlots == null && (tenantId == null || !table.isMultiTenant()) && table.getViewIndexId() == null) { context.setScanRanges(ScanRanges.EVERYTHING); return whereClause; } http://git-wip-us.apache.org/repos/asf/phoenix/blob/9cd0b494/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java index 53647a3..9878777 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java @@ -201,7 +201,8 @@ public class UngroupedAggregateRegionObserver extends BaseScannerRegionObserver long ts = scan.getTimeRange().getMax(); HRegion region = c.getEnvironment().getRegion(); List mutations = Collections.emptyList(); - if (isDelete || isUpsert || (deleteCQ != null && deleteCF != null) || emptyCF != null) { + boolean buildLocalIndex = indexMaintainers != null && dataColumns==null && !localIndexScan; + if (isDelete || isUpsert || (deleteCQ != null && deleteCF != null) || emptyCF != null || buildLocalIndex) { // TODO: size better mutations = Lists.newArrayListWithExpectedSize(1024); batchSize = c.getEnvironment().getConfiguration().getInt(MUTATE_BATCH_SIZE_ATTRIB, QueryServicesOptions.DEFAULT_MUTATE_BATCH_SIZE); @@ -235,8 +236,7 @@ public class UngroupedAggregateRegionObserver extends BaseScannerRegionObserver rowCount++; result.setKeyValues(results); try { - if (indexMaintainers != null && dataColumns==null && !localIndexScan) { - // TODO: join back to data row here if scan attribute set + if (buildLocalIndex) { for (IndexMaintainer maintainer : indexMaintainers) { if (!results.isEmpty()) { result.getKey(ptr);