somandal commented on code in PR #15817:
URL: https://github.com/apache/pinot/pull/15817#discussion_r2093803467


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/segment/SegmentAssignmentUtils.java:
##########
@@ -439,6 +440,29 @@ public Map<String, Map<String, String>> 
getNonTierSegmentAssignment() {
     }
   }
 
+  /**
+   * Return the partitionId for an OFFLINE or REALTIME table
+   */
+  public static int getPartitionId(String segmentName, String tableName, 
TableType tableType, HelixManager helixManager,
+      int numPartitions, @Nullable String partitionColumn) {
+    int partitionId;
+    if (numPartitions == 1) {
+      partitionId = 0;
+    } else {
+      // Uniformly spray the segment partitions over the instance partitions. 
Use the same logic to calculate the
+      // partitionId if partitionColumn or calculated partitionId is null for 
OFFLINE and REALTIME tables
+      if (tableType == TableType.OFFLINE) {
+        partitionId = partitionColumn == null ? 
getDefaultPartitionId(segmentName)

Review Comment:
   the caller does the modulo, and that's what I saw in the code. in some 
places the modulo is done (for replica group assignment) and in some places the 
partitionId is used as is, so decided not to add the modulo to the util directly



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