gjacoby126 commented on a change in pull request #640: PHOENIX-5578 - CREATE
TABLE IF NOT EXISTS loads IndexRegionObserver o…
URL: https://github.com/apache/phoenix/pull/640#discussion_r349399942
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -999,6 +1007,23 @@ private void addCoprocessors(byte[] tableName,
HTableDescriptor descriptor, PTab
}
}
+ private boolean doesPhoenixTableAlreadyExist(HTableDescriptor
existingDesc) {
+ //if the table descriptor already has Phoenix coprocs, we assume it's
+ //already gone through a Phoenix create statement once
+ if (existingDesc == null){
+ return false;
+ }
+ boolean hasScanObserver =
existingDesc.hasCoprocessor(ScanRegionObserver.class.getName());
+ boolean hasUnAggObserver = existingDesc.hasCoprocessor(
+ UngroupedAggregateRegionObserver.class.getName());
+ boolean hasGroupedObserver = existingDesc.hasCoprocessor(
+ GroupedAggregateRegionObserver.class.getName());
+ boolean hasIndexObserver =
existingDesc.hasCoprocessor(Indexer.class.getName())
+ || existingDesc.hasCoprocessor(IndexRegionObserver.class.getName())
+ || existingDesc.hasCoprocessor(GlobalIndexChecker.class.getName());
+ return hasScanObserver && hasUnAggObserver && hasGroupedObserver &&
hasIndexObserver;
Review comment:
Coprocs could exist for other, non-Phoenix reasons, or be incomplete because
of some prior metadata corruption.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services