jackjlli commented on a change in pull request #4103: Add validations to table
config before updating a table config
URL: https://github.com/apache/incubator-pinot/pull/4103#discussion_r274556060
##########
File path:
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
##########
@@ -1160,7 +1113,62 @@ public void addTable(@Nonnull TableConfig tableConfig)
throw new InvalidTableConfigException("UnSupported table type: " +
tableType);
}
- handleBrokerResource(tableNameWithType, brokersForTenant);
+ String brokerTenantName =
TagNameUtils.getBrokerTagForTenant(tableConfig.getTenantConfig().getBroker());
+ handleBrokerResource(tableNameWithType,
HelixHelper.getInstancesWithTag(_helixZkManager, brokerTenantName));
+ }
+
+ /**
+ * Validates the tenant config for the table
+ */
+ private void validateTableTenantConfig(TableConfig tableConfig, String
tableNameWithType, TableType tableType) {
+ TenantConfig tenantConfig = tableConfig.getTenantConfig();
+ if (tenantConfig == null || tenantConfig.getBroker() == null ||
tenantConfig.getServer() == null) {
+ throw new PinotHelixResourceManager.InvalidTableConfigException(
Review comment:
Why do we need to explicitly specify the class as
`PinotHelixResourceManager.InvalidTableConfigException`? Is it ok to just say
`InvalidTableConfigException` since the exception is just in Class
`PinotHelixResourceManager `?
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]