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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to