You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ka...@apache.org on 2019/10/02 04:14:50 UTC

[phoenix] branch 4.x-HBase-1.5 updated: PHOENIX-5503 IndexTool does not rebuild all the rows (addendum)

This is an automated email from the ASF dual-hosted git repository.

kadir pushed a commit to branch 4.x-HBase-1.5
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.5 by this push:
     new 756ce17  PHOENIX-5503 IndexTool does not rebuild all the rows (addendum)
756ce17 is described below

commit 756ce179ad7b7b0db7842e7b3d965c9bce87fef9
Author: Kadir <ko...@salesforce.com>
AuthorDate: Tue Oct 1 19:36:49 2019 -0700

    PHOENIX-5503 IndexTool does not rebuild all the rows (addendum)
---
 .../apache/phoenix/mapreduce/index/IndexTool.java  | 23 +++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
index ea65f22..dbaeead 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
@@ -296,7 +296,7 @@ public class IndexTool extends Configured implements Tool {
         public Job getJob() throws Exception {
             if (isPartialBuild) {
                 return configureJobForPartialBuild();
-            } else if (useSnapshot || !useDirectApi || (!isLocalIndexBuild && pDataTable.isTransactional())) {
+            } else {
                 long maxTimeRange = pIndexTable.getTimeStamp() + 1;
                 // this is set to ensure index tables remains consistent post population.
                 if (pDataTable.isTransactional()) {
@@ -304,16 +304,17 @@ public class IndexTool extends Configured implements Tool {
                             Long.toString(TransactionUtil.convertToNanoseconds(maxTimeRange)));
                     configuration.set(PhoenixConfigurationUtil.TX_PROVIDER, pDataTable.getTransactionProvider().name());
                 }
-                configuration.set(PhoenixConfigurationUtil.CURRENT_SCN_VALUE,
-                        Long.toString(maxTimeRange));
-                return configureJobForAysncIndex();
-            }
-            else {
-                // Local and non-transactional global indexes to be built on the server side
-                // It is safe not to set CURRENT_SCN_VALUE for server side rebuilds, in order to make sure that
-                // all the rows that exist so far will be rebuilt. The current time of the servers will
-                // be used to set the time range for server side scans.
-                return configureJobForServerBuildIndex();
+                if (useSnapshot || !useDirectApi || (!isLocalIndexBuild && pDataTable.isTransactional())) {
+                    configuration.set(PhoenixConfigurationUtil.CURRENT_SCN_VALUE,
+                            Long.toString(maxTimeRange));
+                    return configureJobForAysncIndex();
+                } else {
+                    // Local and non-transactional global indexes to be built on the server side
+                    // It is safe not to set CURRENT_SCN_VALUE for server side rebuilds, in order to make sure that
+                    // all the rows that exist so far will be rebuilt. The current time of the servers will
+                    // be used to set the time range for server side scans.
+                    return configureJobForServerBuildIndex();
+                }
             }
         }