phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject phoenix git commit: PHOENIX-2635 Partial index rebuild doesn't work for mutable data
Date Tue, 16 Feb 2016 17:06:50 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 6ef45b677 -> e88929174


PHOENIX-2635 Partial index rebuild doesn't work for mutable data


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/e8892917
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/e8892917
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/e8892917

Branch: refs/heads/4.x-HBase-1.0
Commit: e88929174e5b5a490100c633ae2147f2a7065582
Parents: 6ef45b6
Author: James Taylor <jtaylor@salesforce.com>
Authored: Tue Feb 16 09:00:24 2016 -0800
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Tue Feb 16 09:05:38 2016 -0800

----------------------------------------------------------------------
 .../apache/phoenix/coprocessor/MetaDataRegionObserver.java  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e8892917/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
index 1371a47..3da409f 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
@@ -56,6 +56,7 @@ import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.phoenix.cache.GlobalCache;
 import org.apache.phoenix.cache.ServerCacheClient;
+import org.apache.phoenix.hbase.index.util.IndexManagementUtil;
 import org.apache.phoenix.index.IndexMaintainer;
 import org.apache.phoenix.index.PhoenixIndexCodec;
 import org.apache.phoenix.jdbc.PhoenixConnection;
@@ -320,8 +321,12 @@ public class MetaDataRegionObserver extends BaseRegionObserver {
                     long timeStamp = Math.max(0, earliestDisableTimestamp - overlapTime);
                     
                     LOG.info("Starting to build indexes=" + indexesToPartiallyRebuild + "
from timestamp=" + timeStamp);
-                    Scan dataTableScan = new Scan();
-                    dataTableScan.setRaw(true);
+                    new Scan();
+                    List<IndexMaintainer> maintainers = Lists.newArrayListWithExpectedSize(indexesToPartiallyRebuild.size());
+                    for (PTable index : indexesToPartiallyRebuild) {
+                        maintainers.add(index.getIndexMaintainer(dataPTable, conn));
+                    }
+                    Scan dataTableScan = IndexManagementUtil.newLocalStateScan(maintainers);
                     dataTableScan.setTimeRange(timeStamp, HConstants.LATEST_TIMESTAMP);
                     byte[] physicalTableName = dataPTable.getPhysicalName().getBytes();
                     try (HTableInterface dataHTable = conn.getQueryServices().getTable(physicalTableName))
{


Mime
View raw message