abhishekbafna commented on code in PR #15726:
URL: https://github.com/apache/pinot/pull/15726#discussion_r2081288250


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -2050,6 +2092,40 @@ public void setExistingTableConfig(TableConfig 
tableConfig)
     setExistingTableConfig(tableConfig, -1);
   }
 
+  /**
+   * Update the logical table config.
+   * @param logicalTableConfig The logical table config to be updated
+   * @throws TableNotFoundException If the logical table does not exist
+   */
+  public void updateLogicalTableConfig(LogicalTableConfig logicalTableConfig)
+      throws TableNotFoundException {
+    String tableName = logicalTableConfig.getTableName();
+    LOGGER.info("Updating logical table {}: Start", tableName);
+
+    if (!ZKMetadataProvider.isLogicalTableExists(_propertyStore, tableName)) {
+      throw new TableNotFoundException("Logical table: " + tableName + " does 
not exist");
+    }
+
+    LOGGER.info("Updating logical table {}: Updating logical table config in 
the property store", tableName);
+    ZKMetadataProvider.setLogicalTableConfig(_propertyStore, 
logicalTableConfig);
+
+    LOGGER.info("Updating logical table {}: Updating BrokerResource for 
table", tableName);
+    updateBrokerResourceForLogicalTable(logicalTableConfig, tableName);

Review Comment:
   Addressed here: 
https://github.com/apache/pinot/pull/15720/commits/22cc927f77dc967f8207fbb76d0e17012145d098



##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java:
##########
@@ -417,6 +417,12 @@ public synchronized void includeServerToRouting(String 
instanceId) {
    * Builds/rebuilds the routing for the given table.
    */
   public synchronized void buildRouting(String tableNameWithType) {

Review Comment:
   Addressed here: 
https://github.com/apache/pinot/pull/15720/commits/22cc927f77dc967f8207fbb76d0e17012145d098



##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -1803,6 +1815,36 @@ public void addTable(TableConfig tableConfig)
     LOGGER.info("Adding table {}: Successfully added table", 
tableNameWithType);
   }
 
+  /**
+   * Adds a logical table.
+   * @param logicalTableConfig The logical table config to be added
+   * @throws TableAlreadyExistsException If the logical table already exists
+   */
+  public void addLogicalTableConfig(LogicalTableConfig logicalTableConfig)
+      throws TableAlreadyExistsException {
+    String tableName = logicalTableConfig.getTableName();
+    LOGGER.info("Adding logical table {}: Start", tableName);
+
+    // Check if the logical table name is already used
+    if (ZKMetadataProvider.isLogicalTableExists(_propertyStore, tableName)) {
+      throw new TableAlreadyExistsException("Logical table: " + tableName + " 
already exists");
+    }
+
+    // Check if the table name is already used by a physical table
+    
getAllTables().stream().map(TableNameBuilder::extractRawTableName).distinct().filter(tableName::equals)

Review Comment:
   Addressed here: 
https://github.com/apache/pinot/pull/15720/commits/22cc927f77dc967f8207fbb76d0e17012145d098



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