hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [5/6] hbase git commit: HBASE-19440 Not able to enable balancer with RSGroups once disabled
Date Wed, 06 Dec 2017 22:29:50 GMT
HBASE-19440 Not able to enable balancer with RSGroups once disabled

Signed-off-by: Andrew Purtell <apurtell@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/48b41c4b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/48b41c4b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/48b41c4b

Branch: refs/heads/branch-1.4
Commit: 48b41c4b13fc4208d4f360e388a66dbe0ce533e3
Parents: 6fcbdc0
Author: Abhishek Singh Chouhan <achouhan@apache.org>
Authored: Wed Dec 6 19:43:30 2017 +0530
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Wed Dec 6 14:18:57 2017 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java       |  2 +-
 .../org/apache/hadoop/hbase/rsgroup/TestRSGroups.java    | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/48b41c4b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java
----------------------------------------------------------------------
diff --git a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java
b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java
index b844651..44bd946 100644
--- a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java
+++ b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java
@@ -684,7 +684,7 @@ public class RSGroupAdminEndpoint extends RSGroupAdminService
   @Override
   public boolean preBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> ctx,
                                   boolean newValue) throws IOException {
-    return false;
+    return newValue;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hbase/blob/48b41c4b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
----------------------------------------------------------------------
diff --git a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
index d3c546e..081c0a3 100644
--- a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
+++ b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
@@ -54,6 +54,7 @@ import java.io.IOException;
 import java.util.Iterator;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -279,6 +280,16 @@ public class TestRSGroups extends TestRSGroupsBase {
   }
 
   @Test
+  public void testRSGroupBalancerSwitch() throws IOException {
+    //Balancer is initially off in the test, set to true and check
+    assertFalse(admin.setBalancerRunning(true, true));
+    assertTrue(admin.isBalancerEnabled());
+    //Set balancer off and check if it actually turned off
+    assertTrue(admin.setBalancerRunning(false,true));
+    assertFalse(admin.isBalancerEnabled());
+  }
+
+  @Test
   public void testCloneSnapshot() throws Exception {
     final TableName tableName = TableName.valueOf(tablePrefix+"_testCloneSnapshot");
     LOG.info("testCloneSnapshot");


Mime
View raw message