You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2017/12/06 22:29:50 UTC
[5/6] hbase git commit: HBASE-19440 Not able to enable balancer with
RSGroups once disabled
HBASE-19440 Not able to enable balancer with RSGroups once disabled
Signed-off-by: Andrew Purtell <ap...@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 <ac...@apache.org>
Authored: Wed Dec 6 19:43:30 2017 +0530
Committer: Andrew Purtell <ap...@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");