tkhurana commented on code in PR #1748:
URL: https://github.com/apache/phoenix/pull/1748#discussion_r1419768342


##########
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -555,6 +560,24 @@ private void openConnection() throws SQLException {
         }
     }
 
+    /*
+    We create a long-lived hbase connection to run invalidate cache RPCs. We 
override
+    CUSTOM_CONTROLLER_CONF_KEY to instantiate 
InvalidateMetadataCacheController which has
+    a special priority for invalidate metadata cache operations.
+ */
+    public Connection getInvalidateMetadataCacheConnection() throws 
IOException {
+        if (invalidateMetadataCacheConnection != null) {
+            return invalidateMetadataCacheConnection;
+        }
+        // TODO Do we need a double locking here?
+        Configuration clonedConfiguration = 
PropertiesUtil.cloneConfig(this.config);
+        clonedConfiguration.setClass(CUSTOM_CONTROLLER_CONF_KEY,
+                InvalidateMetadataCacheControllerFactory.class, 
RpcControllerFactory.class);
+        invalidateMetadataCacheConnection = 
ConnectionFactory.createConnection(clonedConfiguration);

Review Comment:
   `openConnection()` method uses `HBaseFactoryProvider.getHConnectionFactory()`



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

To unsubscribe, e-mail: issues-unsubscr...@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to