bbeaudreault commented on a change in pull request #3536:
URL: https://github.com/apache/hbase/pull/3536#discussion_r686079681
##########
File path:
hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
##########
@@ -541,6 +544,11 @@ public boolean balanceRSGroup(String groupName) throws
IOException {
getRSGroupAssignmentsByTable(master.getTableStateManager(),
groupName);
List<RegionPlan> plans = balancer.balanceCluster(assignmentsByTable);
boolean balancerRan = !plans.isEmpty();
+
+ if (request.isDryRun()) {
+ return balancerRan;
Review comment:
Note: there's still some value in returning as I already have it
implemented. The true value here does actually denote that the balancer ran --
it just didn't execute any moves. There are cases where this would be false,
meaning the dry run literally didn't even try to execute. That would happen if
there was already a balance in progress or if the cluster was in maintenance
mode.
I'm thinking a BalanceResponse could have three fields for now:
- boolean balancerRan (this would remain as today)
- int movesCalculated (this would be the same for dryrun vs execute)
- int movesExecuted (this would be 0 for dryRun and probably equal to
movesCalculated for execute)
I'll throw that up as a first pass and see what people think. I think
there's much more we could do here in the future, but I'd prefer not to further
bloat this PR if possible. This will at least put a stake in the ground for the
new API, and then we can backwards compatibly evolve it from there.
--
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]