GSharayu commented on code in PR #9309:
URL: https://github.com/apache/pinot/pull/9309#discussion_r969857599


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/segment/SegmentAssignmentUtils.java:
##########
@@ -388,4 +395,89 @@ public Map<String, Map<String, String>> 
getNonTierSegmentAssignment() {
       return _nonTierSegmentAssignment;
     }
   }
+
+  /**
+   * Returns a partition id for offline table
+   */
+  public static int getOfflineSegmentPartitionId(String segmentName, String 
offlineTableName,
+      HelixManager helixManager, @Nullable String partitionColumn) {
+    SegmentZKMetadata segmentZKMetadata =
+        
ZKMetadataProvider.getSegmentZKMetadata(helixManager.getHelixPropertyStore(), 
offlineTableName, segmentName);
+    Preconditions.checkState(segmentZKMetadata != null,
+        "Failed to find segment ZK metadata for segment: %s of table: %s", 
segmentName, offlineTableName);
+    return getPartitionId(segmentZKMetadata, offlineTableName, 
partitionColumn);
+  }
+
+  private static int getPartitionId(SegmentZKMetadata segmentZKMetadata,
+      String offlineTableName, @Nullable String partitionColumn) {

Review Comment:
   Yes, the referencing function is getOfflineSegmentPartitionId 



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