sajjad-moradi commented on code in PR #8584:
URL: https://github.com/apache/pinot/pull/8584#discussion_r872666499


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -1995,23 +1992,23 @@ public SegmentZKMetadata 
constructZkMetadataForNewSegment(String tableNameWithTy
   public void assignTableSegment(String tableNameWithType, String segmentName) 
{
     String segmentZKMetadataPath =
         
ZKMetadataProvider.constructPropertyStorePathForSegment(tableNameWithType, 
segmentName);
-    InstancePartitionsType instancePartitionsType;
-    if (TableNameBuilder.isRealtimeTableResource(tableNameWithType)) {
-      // In an upsert enabled LLC realtime table, all segments of the same 
partition are collocated on the same server
-      // -- consuming or completed. So it is fine to use CONSUMING as the 
InstancePartitionsType.
-      // TODO When upload segments is open to all realtime tables, we should 
change the type to COMPLETED instead.
-      // In addition, RealtimeSegmentAssignment.assignSegment(..) method 
should be updated so that the method does not
-      // assign segments to CONSUMING instance partition only.
-      instancePartitionsType = InstancePartitionsType.CONSUMING;
-    } else {
-      instancePartitionsType = InstancePartitionsType.OFFLINE;
-    }
 
     // Assign instances for the segment and add it into IdealState
     try {
       TableConfig tableConfig = getTableConfig(tableNameWithType);
       Preconditions.checkState(tableConfig != null, "Failed to find table 
config for table: " + tableNameWithType);
-      SegmentAssignment segmentAssignment = 
SegmentAssignmentFactory.getSegmentAssignment(_helixZkManager, tableConfig);
+      InstancePartitionsType instancePartitionsType;
+      if (TableNameBuilder.isRealtimeTableResource(tableNameWithType)) {

Review Comment:
   Makes sense. Refactored.



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