shounakmk219 commented on code in PR #11077:
URL: https://github.com/apache/pinot/pull/11077#discussion_r1262024816


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -4128,6 +4129,29 @@ public PeriodicTaskInvocationResponse 
invokeControllerPeriodicTask(String tableN
     return new PeriodicTaskInvocationResponse(periodicTaskRequestId, 
messageCount > 0);
   }
 
+  /**
+   * Construct a map of all the tenants and their respective minimum server 
requirements.
+   * The minimum server requirement is computed by iterating over all the 
tables of the tenant and
+   * find the table with maximum replication.
+   * @return map of tenants and their minimum server requirements
+   */
+  public Map<String, Integer> minimumServersRequiredForTenants() {
+    Map<String, Integer> tenantMinServerMap = new HashMap<>();
+    getAllServerTenantNames().forEach(tenant -> tenantMinServerMap.put(tenant, 
0));
+    for (String table : getAllTables()) {
+      TableConfig tableConfig = getTableConfig(table);

Review Comment:
   Makes sense to pull all the table configs at once and iterate on them 
directly. Not sure if passing the list would be a good option atleast for now 
as that puts unnecessary burden on the caller function.



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