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

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

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


##########
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:
   Could we fetch the tableConfigs all at once instead? We may pass list<TableConfigs> to this 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