petersomogyi commented on a change in pull request #592: HBASE-22982: region 
server suspend/resume and graceful rolling restart actions
URL: https://github.com/apache/hbase/pull/592#discussion_r328019053
 
 

 ##########
 File path: 
hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java
 ##########
 @@ -269,6 +298,19 @@ protected void forceBalancer() throws Exception {
     }
   }
 
+  protected void setBalancer(boolean onOrOff, boolean synchronous) throws 
Exception {
+    Admin admin = this.context.getHBaseIntegrationTestingUtility().getAdmin();
+    boolean result = false;
+    try {
+      result = admin.balancerSwitch(onOrOff, synchronous);
+    } catch (Exception e) {
+      LOG.warn("Got exception while switching balance ", e);
+    }
+    if (!result) {
 
 Review comment:
   admin.balancerSwitch returns the previous state. If you disable balancer 
`result` will be `true` and logs the error.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to