You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "shounakmk219 (via GitHub)" <gi...@apache.org> on 2023/07/13 05:59:58 UTC

[GitHub] [pinot] shounakmk219 commented on a diff in pull request #11077: (WIP) Instance retag validation check api

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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org