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

[phoenix] branch 4.14-HBase-1.4 updated: PHOENIX-5359: Remove (Global-Indexing)new coprocessors in CQSI#addCoprocessors with flag(INDEX_REGION_OBSERVER_ENABLED_ATTRIB) disabled

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

skadam pushed a commit to branch 4.14-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.14-HBase-1.4 by this push:
     new 6c25645  PHOENIX-5359: Remove (Global-Indexing)new coprocessors in CQSI#addCoprocessors with flag(INDEX_REGION_OBSERVER_ENABLED_ATTRIB) disabled
6c25645 is described below

commit 6c25645a4e8f27f914a23d06bfe4bf23963ff21b
Author: s.kadam <sk...@apache.org>
AuthorDate: Wed Jun 26 19:43:14 2019 -0700

    PHOENIX-5359: Remove (Global-Indexing)new coprocessors in CQSI#addCoprocessors with flag(INDEX_REGION_OBSERVER_ENABLED_ATTRIB) disabled
---
 .../apache/phoenix/query/ConnectionQueryServicesImpl.java  | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index 72aaa41..4531c45 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -850,12 +850,14 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement
             boolean isTransactional =
                     Boolean.TRUE.equals(tableProps.get(TableProperty.TRANSACTIONAL.name())) || nonTxToTx;
 
-            boolean globalIndexerEnabled = config.getBoolean(
+            boolean indexRegionObserverEnabled = config.getBoolean(
                     QueryServices.INDEX_REGION_OBSERVER_ENABLED_ATTRIB,
                     QueryServicesOptions.DEFAULT_INDEX_REGION_OBSERVER_ENABLED);
 
             if (tableType == PTableType.INDEX && !isTransactional) {
-                if (globalIndexerEnabled && !descriptor.hasCoprocessor(GlobalIndexChecker.class.getName())) {
+                if (!indexRegionObserverEnabled && descriptor.hasCoprocessor(GlobalIndexChecker.class.getName())) {
+                    descriptor.removeCoprocessor(GlobalIndexChecker.class.getName());
+                } else if (indexRegionObserverEnabled && !descriptor.hasCoprocessor(GlobalIndexChecker.class.getName())) {
                     descriptor.addCoprocessor(GlobalIndexChecker.class.getName(), null, priority - 1, null);
                 }
             }
@@ -897,7 +899,10 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement
                     if (descriptor.hasCoprocessor(PhoenixTransactionalIndexer.class.getName())) {
                         descriptor.removeCoprocessor(PhoenixTransactionalIndexer.class.getName());
                     }
-                    if (globalIndexerEnabled) {
+                    if (indexRegionObserverEnabled) {
+                        if (descriptor.hasCoprocessor(Indexer.class.getName())) {
+                            descriptor.removeCoprocessor(Indexer.class.getName());
+                        }
                         if (!descriptor.hasCoprocessor(IndexRegionObserver.class.getName())) {
                             Map<String, String> opts = Maps.newHashMapWithExpectedSize(1);
                             opts.put(NonTxIndexBuilder.CODEC_CLASS_NAME_KEY, PhoenixIndexCodec.class.getName());
@@ -905,6 +910,9 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement
                         }
 
                     } else {
+                        if (descriptor.hasCoprocessor(IndexRegionObserver.class.getName())) {
+                            descriptor.removeCoprocessor(IndexRegionObserver.class.getName());
+                        }
                         if (!descriptor.hasCoprocessor(Indexer.class.getName())) {
                             Map<String, String> opts = Maps.newHashMapWithExpectedSize(1);
                             opts.put(NonTxIndexBuilder.CODEC_CLASS_NAME_KEY, PhoenixIndexCodec.class.getName());