abhishekbafna commented on code in PR #15726:
URL: https://github.com/apache/pinot/pull/15726#discussion_r2079008612
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -2050,6 +2091,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 updateLogicalTable(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);
+
+ LOGGER.info("Updated logical table {}: Successfully updated table",
tableName);
+ }
+
+ private void updateBrokerResourceForLogicalTable(LogicalTableConfig
logicalTableConfig, String tableName) {
+ List<String> brokers = HelixHelper.getInstancesWithTag(
Review Comment:
This is same logic in the table config update.
In case of the empty response, it would update the same in the Ideal State
and no updates would be sent to EV.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]