gokceni commented on a change in pull request #517: PHOENIX-5211 Consistent 
Immutable Global Indexes for Non-Transactiona…
URL: https://github.com/apache/phoenix/pull/517#discussion_r298391910
 
 

 ##########
 File path: phoenix-core/src/main/java/org/apache/phoenix/util/IndexUtil.java
 ##########
 @@ -294,11 +305,37 @@ private static boolean isEmptyKeyValue(PTable table, 
ColumnReference ref) {
                             .getLength()) == 0);
     }
 
+
+    public static boolean isGlobalIndexCheckerEnabled(PhoenixConnection 
connection, PName index)
+            throws SQLException {
+        String indexName = index.getString();
+        Boolean entry = 
IndexNameGlobalIndexCheckerEnabledMap.getIfPresent(indexName);
+        if (entry != null){
+            return entry;
+        }
+
+        boolean result = false;
+        try {
+            TableDescriptor desc = 
connection.getQueryServices().getTableDescriptor(index.getBytes());
+
+            if (desc != null) {
+                if (desc.hasCoprocessor(GlobalIndexChecker.class.getName())) {
+                    result = true;
+                }
+            }
+            IndexNameGlobalIndexCheckerEnabledMap.put(indexName, result);
+        } catch (TableNotFoundException ex) {
 
 Review comment:
   The thing is I don't have PTable, I have just the name. It is in that 
TableRef object. There is a ptable but it is the base table

----------------------------------------------------------------
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

Reply via email to