krishan1390 commented on code in PR #17706:
URL: https://github.com/apache/pinot/pull/17706#discussion_r2811493920


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -770,12 +770,9 @@ public Map<String, Map<String, String>> 
getZookeeperMetadata(
     String tableNameWithType =
         
ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, 
tableName, tableType, LOGGER).get(0);
     Map<String, Map<String, String>> segmentToMetadataMap = new HashMap<>();
-    List<SegmentZKMetadata> segmentZKMetadataList =
-        _pinotHelixResourceManager.getSegmentsZKMetadata(tableNameWithType);
-
-    for (SegmentZKMetadata segmentZKMetadata : segmentZKMetadataList) {
+    _pinotHelixResourceManager.forEachSegmentsZKMetadata(tableNameWithType, 
segmentZKMetadata -> {

Review Comment:
   Won't this actually be slower due to more ZK point calls rather than earlier 
getChildren() calls ? 
   
   I think if use cases require all data, then earlier getChildren() calls is 
probably a better choice. 



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