jasperjiaguo commented on code in PR #11578:
URL: https://github.com/apache/pinot/pull/11578#discussion_r1370851013


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotInstanceAssignmentRestletResource.java:
##########
@@ -244,20 +244,32 @@ public Map<String, InstancePartitions> assignInstances(
   private void assignInstancesForInstancePartitionsType(Map<String, 
InstancePartitions> instancePartitionsMap,
       TableConfig tableConfig, List<InstanceConfig> instanceConfigs, 
InstancePartitionsType instancePartitionsType) {
     String tableNameWithType = tableConfig.getTableName();
-    if (TableConfigUtils.hasPreConfiguredInstancePartitions(tableConfig, 
instancePartitionsType)) {
+    if (!TableConfigUtils.hasPreConfiguredInstancePartitions(tableConfig, 
instancePartitionsType)) {
+      InstancePartitions existingInstancePartitions =
+          
InstancePartitionsUtils.fetchInstancePartitions(_resourceManager.getHelixZkManager().getHelixPropertyStore(),
+              
InstancePartitionsUtils.getInstancePartitionsName(tableNameWithType, 
instancePartitionsType.toString()));
+      instancePartitionsMap.put(instancePartitionsType.toString(),
+          new 
InstanceAssignmentDriver(tableConfig).assignInstances(instancePartitionsType, 
instanceConfigs,
+              existingInstancePartitions));
+    } else if 
(InstanceAssignmentConfigUtils.isPreConfigurationBasedAssignment(tableConfig, 
instancePartitionsType)) {
+      InstancePartitions existingInstancePartitions =
+          
InstancePartitionsUtils.fetchInstancePartitions(_resourceManager.getHelixZkManager().getHelixPropertyStore(),
+              
InstancePartitionsUtils.getInstancePartitionsName(tableNameWithType, 
instancePartitionsType.toString()));
+      String rawTableName = 
TableNameBuilder.extractRawTableName(tableNameWithType);
+      InstancePartitions preConfigured =

Review Comment:
   The behavior is intended here. Will add some comments to explain 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