Jackie-Jiang commented on a change in pull request #5015: Enhance 
TableRebalancer to support reassigning COMPLETED segments when instances changed
URL: https://github.com/apache/incubator-pinot/pull/5015#discussion_r371432662
 
 

 ##########
 File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/segment/RealtimeSegmentAssignment.java
 ##########
 @@ -143,62 +156,81 @@ public void init(HelixManager helixManager, TableConfig 
tableConfig) {
   @Override
   public Map<String, Map<String, String>> rebalanceTable(Map<String, 
Map<String, String>> currentAssignment,
       Map<InstancePartitionsType, InstancePartitions> instancePartitionsMap, 
Configuration config) {
+    InstancePartitions completedInstancePartitions = 
instancePartitionsMap.get(InstancePartitionsType.COMPLETED);
+    InstancePartitions consumingInstancePartitions = 
instancePartitionsMap.get(InstancePartitionsType.CONSUMING);
+    Preconditions.checkState(consumingInstancePartitions != null,
+        "Failed to find COMPLETED or CONSUMING instance partitions for table: 
%s", _realtimeTableName);
+    Preconditions.checkState(consumingInstancePartitions.getNumPartitions() == 
1,
 
 Review comment:
   Good point. Added comments in the InstancePartitions

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

Reply via email to