ankitsultana commented on code in PR #8989: URL: https://github.com/apache/pinot/pull/8989#discussion_r920217281
########## pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/instance/InstanceAssignmentDriver.java: ########## @@ -55,19 +58,36 @@ public InstanceAssignmentDriver(TableConfig tableConfig) { public InstancePartitions assignInstances(InstancePartitionsType instancePartitionsType, List<InstanceConfig> instanceConfigs, @Nullable InstancePartitions existingInstancePartitions) { String tableNameWithType = _tableConfig.getTableName(); - LOGGER.info("Starting {} instance assignment for table: {}", instancePartitionsType, tableNameWithType); + Preconditions.checkState(!TableConfigUtils.isTableInGroup(_tableConfig)); InstanceAssignmentConfig assignmentConfig = InstanceAssignmentConfigUtils.getInstanceAssignmentConfig(_tableConfig, instancePartitionsType); + String instancePartitionsName = instancePartitionsType.getInstancePartitionsName( + TableNameBuilder.extractRawTableName(tableNameWithType)); + return assignInstances(instancePartitionsName, + tableNameWithType, instanceConfigs, assignmentConfig, existingInstancePartitions); + } + + public static InstancePartitions assignInstancesToGroup(String groupName, + List<InstanceConfig> instanceConfigs, InstanceAssignmentConfig assignmentConfig) { + String instancePartitionsName = InstancePartitionsUtils.getGroupInstancePartitionsName(groupName); + return assignInstances(instancePartitionsName, groupName, instanceConfigs, assignmentConfig, null); + } + + private static InstancePartitions assignInstances(String instancePartitionsName, String entityName, Review Comment: Yeah so this method is essentially getting called for both a table-group and a table itself, so it could either be a table-group name or a table name. This name is being used for logging and performing hash-based rotations (e.g. `HashBasedRotateInstanceConstraintApplier`). -- 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