yashmayya commented on code in PR #16189: URL: https://github.com/apache/pinot/pull/16189#discussion_r2164600977
########## pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/TableRebalanceManager.java: ########## @@ -69,6 +69,32 @@ public TableRebalanceManager(PinotHelixResourceManager resourceManager, Controll _executorService = executorService; } + /** + * Do a table rebalance dry-run for the table with the given name and type. + * + * @param tableNameWithType name of the table to rebalance + * @param rebalanceConfig configuration for the rebalance operation + * @param rebalanceJobId ID of the rebalance job, which is used to track the progress of the rebalance operation + * @return result of the rebalance dry-run operation + * @throws TableNotFoundException if the table does not exist + */ + public RebalanceResult rebalanceTableDryRun(String tableNameWithType, RebalanceConfig rebalanceConfig, + String rebalanceJobId) + throws TableNotFoundException { + Preconditions.checkArgument(rebalanceConfig.isDryRun() || rebalanceConfig.isPreChecks()); + TableConfig tableConfig = _resourceManager.getTableConfig(tableNameWithType); + if (tableConfig == null) { + throw new TableNotFoundException("Failed to find table config for table: " + tableNameWithType); + } + Preconditions.checkState(rebalanceJobId != null, "RebalanceId not populated in the rebalanceConfig"); + try { + return rebalanceTable(tableNameWithType, tableConfig, rebalanceJobId, rebalanceConfig, null); + } catch (RebalanceInProgressException e) { + // This should not happen for dry-run rebalances + throw new IllegalStateException(e); Review Comment: The method delegated to here doesn't perform the rebalance in progress check for dry-runs, so this can only be thrown if there's a code-level error in the future (and not user action related), so I chose to omit an additional log here. -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org