vrajat commented on code in PR #15515:
URL: https://github.com/apache/pinot/pull/15515#discussion_r2059636180


##########
pinot-common/src/main/java/org/apache/pinot/common/config/provider/TableCache.java:
##########
@@ -390,6 +423,78 @@ private List<Schema> getSchemas() {
     return schemas;
   }
 
+  private void addLogicalTables(List<String> paths) {
+    // Subscribe data changes before reading the data to avoid missing changes
+    for (String path : paths) {
+      _propertyStore.subscribeDataChanges(path, _zkLogicalTableChangeListener);
+    }
+    List<ZNRecord> znRecords = _propertyStore.get(paths, null, 
AccessOption.PERSISTENT);
+    for (ZNRecord znRecord : znRecords) {
+      if (znRecord != null) {
+        try {
+          putLogicalTable(znRecord);
+        } catch (Exception e) {
+          LOGGER.error("Caught exception while adding logical table for 
ZNRecord: {}", znRecord.getId(), e);
+        }
+      }
+    }
+  }
+
+  private void putLogicalTable(ZNRecord znRecord)
+      throws IOException {
+    LogicalTable logicalTable = LogicalTableUtils.fromZNRecord(znRecord);
+    String logicalTableName = logicalTable.getTableName();

Review Comment:
   +1. And tests for it. 



-- 
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: commits-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to