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


##########
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:
   For propertyStore, underlying it's also wrapping a for loop on top of 
zkclient to call each path to fetch the znRecord then construct the segment 
metadata.
   
   So there is no difference in terms of the zk overhead.
   
   GetChildren for all segment name is always just one zk call to fetch all.



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