bbeaudreault commented on a change in pull request #3536:
URL: https://github.com/apache/hbase/pull/3536#discussion_r683759313
##########
File path: hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
##########
@@ -1253,6 +1253,15 @@ default boolean balancer() throws IOException {
*/
boolean balance() throws IOException;
+ /**
+ * Invoke the balancer in dry run mode. Will show plan but not actually move
any regions.
+ * Can NOT run for various reasons. Check logs.
+ *
+ * @return <code>true</code> if dry run ran, <code>false</code> otherwise.
+ * @throws IOException if a remote or network exception occurs
+ */
+ boolean dryRunBalance() throws IOException;
Review comment:
Thank you for the comment @clarax. I'm working on this new. I've decided
to call it BalanceRequest, because that felt more natural (and also doesn't
conflate configs that affect balancer like cost functions).
For now the API is very simple, so I decided against a builder. Instead it's
a static factory for now, with 3 static methods:
- `#forExecution()` -- normal run
- `#forExecutionIgnoringRegionsInTransition()` -- normal run but ignore
regions in transition. This is the replacement for `boolean force`. It's more
verbose but also clearer what it does. IF we decide to add other force-like
features in the future, we can give them each their own setter in a builder.
- `#forDryRun()` -- dry run mode
In HBASE-26177 we could add a new `forDryRun(CostConfigs)` or something. Or
we can turn it into a builder at that point, if we decide that it makes sense
to allow in both modes. For example,
`BalancerRequest.forDryRun().withCostConfigs(CostConfigs).build()`
I'm just working on plumbing this all around now. Behind the scenes we are
using the same RunMode enum I added in this PR, but that is an
InterfaceAudience.PRIVATE, for internal use.
--
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]