phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject git commit: PHOENIX-1149 Index mutations should be committed as batches while building local index (Rajeshbabu)
Date Wed, 06 Aug 2014 16:42:12 GMT
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 <jtaylor@salesforce.com>
Authored: Wed Aug 6 09:45:40 2014 -0700
Committer: James Taylor <jtaylor@salesforce.com>
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<Expression> 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<Mutation> 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);


Mime
View raw message