J-HowHuang commented on code in PR #15575: URL: https://github.com/apache/pinot/pull/15575#discussion_r2051176216
########## pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/rebalance/DefaultRebalancePreChecker.java: ########## @@ -379,6 +382,58 @@ private RebalancePreCheckerResult checkRebalanceConfig(RebalanceConfig rebalance : RebalancePreCheckerResult.warn(StringUtil.join("\n", warnings.toArray(String[]::new))); } + private RebalancePreCheckerResult checkReplicaGroups(TableConfig tableConfig, RebalanceConfig rebalanceConfig) { + String message; + if (tableConfig.getTableType() == TableType.OFFLINE) { + message = "OFFLINE segments - " + getReplicaGroupInfo(tableConfig, InstancePartitionsType.OFFLINE); + } else { + // for realtime table + message = "COMPLETED segments - " + getReplicaGroupInfo(tableConfig, InstancePartitionsType.COMPLETED) + "\n" + + "CONSUMING segments - " + getReplicaGroupInfo(tableConfig, InstancePartitionsType.CONSUMING); + } + String tierMessage = ""; + if (tableConfig.getTierConfigsList() != null) { + List<String> tierMessageList = new ArrayList<>(); + for (TierConfig tierConfig : tableConfig.getTierConfigsList()) { + tierMessageList.add(tierConfig.getName() + " tier - " + getReplicaGroupInfo(tableConfig, tierConfig.getName())); + } + tierMessage = "\n" + StringUtil.join("\n", tierMessageList.toArray(String[]::new)); + } + if (rebalanceConfig.isReassignInstances()) { + return RebalancePreCheckerResult.pass(message + tierMessage); + } + return RebalancePreCheckerResult.warn( Review Comment: Updated. Only throw warning if replica group is enabled for at least one segment type or tier. -- 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